Data Analysis Workshop - Day 2 | Myntra Data Analysis | GeeksforGeeks
Skills:
Data Literacy80%
Key Takeaways
Conducts a data analysis workshop on Myntra data, led by Ashish Jangra from GeeksforGeeks
Full Transcript
yes so i'm hoping i'm i'm audible now so uh let's uh jump into the topic again and if there is any issue do let me know in the chats okay i'm reading the comments so uh this is about the data set that we are having yesterday okay we are having the name of the product which brand that belongs to parts rating how many people have rated that what's the mark price discounted price but are the different sizes of the product that are available okay i think okay it's audible now great so if it is assured so definitely there are going to be different sizes of the product if it is a printed t-shirt so then there is going to be again couple of sizes for the product so here you can see uh if it is a leather full wallet so obviously there is only one size available for that product so that's that's obviously will be there okay where is the link okay the link is given in the description okay of this data set here so we are having mark price we are having discounted price we are having sizes of the product we are also having the product link that's something that is not of our use now i'm going to remove these columns okay similarly for the image link product tags these are very important things okay for example here you can see this is men's casual shirt this is also shirt what is this this is a wallet so if i'm going back this will tell you exactly what that product is it's a shirt it's a t-shirt it's a wallet it's a saree it's a kurta okay these are the thing that is there in in this product tag so we need to take this product tax very carefully we are also having brand tag which brand that product belongs to right here you can see we are having a lot of brands we are going to discuss about these brands as well we are going to analyze a lot of things from this what is this discounted amount okay how much discount we are giving after discount what is the final amount and what is the discount percentage we are given so that people can sort based on the discount simple funda we are also having the tags of the product like uh the shirt was comes under clothing men's clothing shirts and green fiber which is the brand name so even if uh the person is searching for either of the tags this product will be displayed okay similarly we are having the seller uh details from this from which our place uh we are having these uh sellers we are also having the meta description like uh what are all the things we are having of that particular product yeah so what i am going to do i am going to first of all uh check the null values on the data set and to check the null values here you can see if i'm printing df this will print you all the data okay but if i'm going back and here if i'm printing df dot is null it is printing true or false okay why it is printing true and false true will be printed only and only if that particular cell is null okay and false is printed when the particular cell is not null sorted so what we are going to do now we are going to take this thing into further place so here you can see if i am writing dot sum at b and executed this will tell you in which column we are having how many null values so here you can see we are having zero null value in all the columns we are having no null value right and that's a perfect dataset to have because we don't need to deal with the null values because we are not having any null value here once we are not having the null value so let's do one thing which is the second step you can do it vice versa okay either you can first of all remove the unnecessary column okay and that's something i'm going to do now remove the columns that are not and that we are not going to use so i'm again uh changing it to a markdown and here we are going to remove those columns okay so what are going to be the column that i want to delete so i need to delete which column first of all i delete this uh product link column then i'll also delete which column image link column okay then i will delete the uh i think we can delete the meta description and meta key meta keyword and meta description okay and meta description sorry so these are the columns that i am going to remove after removing those columns if i'm checking bf.head here you can see the columns are removed earlier i was having 17 columns now i'm only having after removing four of them i'll be having a 13 column right these are the final column that we are having now you know so what should be the next step the next step is once i am having this particular kind of data i need to think about what i need to analyze okay and before analyzing here let me tell you one very important thing you know if i'm talking about let's suppose there here we are having three kind of basically data okay i am having numeric data numeric means either integer or float okay or we are having text data and text is again divided into two parts in text we are either having a unique data or categorical data yeah for example if i'm talking about a product name so product name is not a category right so what product name might be unique for all the products right here you can see slim fit casual search might be uh the product name of a lot of products right but when we are adding a product brand into it so that will be a totally different thing so product name is not amenity that it would be unique but brand name is something which is unique we are not going to have that much of brand as much product names we are having right so brand name is nothing but a category right so we are going to take this brand name as a category and so that accordingly we can see how many products of green field we are having how many products of da milano we are having okay and how many products of the indo era we are having what's the average rating of indo-era products what is the average price of andover product through which i can see okay if there is a person coming in and he want to purchase one product so how much here she is going to spend if he is going for damilano as compared to green fiber as compared to indoor which will tell you how expensive these brands are okay how much wide variety of products those companies are selling okay there are a lot of possibility from this data set that you can do a lot of things that you can do from this data set sorted so what should be the next step the next step is once we are having all these things ready okay so let's start with the data analysis on numeric uh numeric or float values here so let's do one thing let me add the markdown and let's go with the third step of data analysis and that's on numeric column okay here we are going to discuss about a categorical column we are going to do a lot of analysis we are going to pre-process this data set as well that's also very important thing okay there might be a couple of columns that i can not directly use for example if i'm talking about the address okay so from address here you can see this is the address of bangalore this is the address of new delhi so you can from here you can sort okay from which particular city we are having most of the sellers okay how many sellers are there are there uh from delhi how many sellers are there from bengaluru okay or if i'm talking about let's suppose da milano where are all the sellers distributed all all over the nation right there are a lot of possibilities that will work here for example if you are in delhi and you want to purchase a product from da milano okay and the best way to get that product is obviously from the localities which are near delhi you are not going to import it from uh basically uh bangalore if you are having a seller at bangalore you will take it only for the ones which are very close to you right and this is how this data set will help you to find these things you know so let's talk about rating now here and for rating what i'm going to do i'm going to take the rating column okay if i'm taking the rating column here you can see this is offload 64. okay now from throughout the dataset that is not going to make that much sense to analyze it but let's see how this can be done if i want to know what is the average uh rating of a product throughout the data set i'm talking about average rating okay so i can find me if i'm executing it average rating is 2.18 that might be because there are a lot of product unrated there is no any uh rating given right that's also a particular case let's suppose i want to know about the rating only the products where rating is given where there are a couple of people who are given the rating then for those particular products what is the average rating make sense right so what we are going to do i am going for i in df operating if i am printing i it will print rating one by one and i'm writing ratio so that it will not print all the 24 000 values so what i will do here here i'm going to check if i is not equals to 0.0 means if the rating of that product is not 0.0 then only i am going to take that as rating okay and then what i am going to do i am going to take rating plus equals to that particular rate plus equals to i got it and here you can also take a counter which will tell you how many ratings we have taken okay and counter plus equals to 1 got it so now if i am executing it and printing rat this is the total rating of all the products which are having rating non-zero right i'm hoping you're you're understanding what i want to convey okay or if you are having any uh problem at any point of time do let me know okay so here you can see if i'm printing rating this is the rating of all the products let's type translate into integer so this is the rating of all the non uh non-zero rating products let's see how many total products are there there are total 12 773 products so now if i'm dividing that by c so here you can see the average rating of the products where people have given the rating is 4.15 that is very very nice as compared to the rating that i am directly getting by finding the mean okay here you can see 2.18 because there are a lot of products where rating is not given clear so that's also important factor you need to have a good analysis uh good knowledge of analysis that's how the things are working how the data is distributed these kind of thing you need to know here so from from reading you are having now a clear understanding that if i'm printing c and printing the length of data frame there are total 24 000 uh products out of those 4 000 products if i'm subtracting c from it eleven thousand five hundred eleven products are there whose rating is zero means there is no one who has given that rating sorted clear if anyone is having any doubt do let me know in the chat okay and one more one more thing that i want to add for sure and that is if you are having any question that you want to find from this data set do let me know in the chats okay i'll be more than happy to answer uh those questions live clear so far we have find the average rating so let's print it here and whatever you are getting let's convert into float by the way it will be uh taken as a flute so we can round that off right so i think a rounding off will help d2 so this is the average rating of the product of non zeros yeah let me add it here as well average heating of a product so that's the answer that we are getting let's uh take the data set again and let's see what are all the other things that i can analyze from it okay so from here let's suppose i want to specifically choose only the products of da milano okay how i can do that okay and if you want to stick into only the numerical ones if i want to know about the most expensive products right but which one is the most expensive product out there in the in the whole data set okay that's that might be i think a good a good place to start so let's let's go there and find the most expensive products okay i'm adding it to the markdown and finding most expensive product and this is nothing but 3.2 so now we need to find the most expensive product to find the most expensive product we are having a lot of which to deal with it and the easiest way is to find the most expensive product we need to take here which you are talking about we are talking about either the marked price or the discounted price right there might be a product which cost uh for example let's suppose 50 000 and is selling for just 10 000 right and there might be a product which is having a price of only 25 000 it is still selling for 20 000 so it is not about just the mark prices about discounted price as well and we are going to deal with both of them okay so let's take the first one of uh marked price okay and what i'll do now i take marg price so here you can see this is what i have found from here i need to found the maximum value the maximum value is 44 950 rupees this is the price of the most expensive product that we are having okay and now what i want i want to know about the details of that product what that product is okay so to do that what i'm going to do i'm taking the same thing okay the same data set and i want to find the i'll go to the original data frame now okay and from here what i want i want to take the row where marked price is equals to forty four thousand nine hundred fifty simple it seem like sql like select star from uh rows where uh mark price is equal to is equal to this month very simple so what i am going to do i am going to take marked price okay and i am going to write equals to is equals to the exact price i am talking about execute it and here you can see it is telling you only the true and false okay now what i can do it will only return you ah true where the value is still for example here you can see one six six nine which is at the top if i'm writing it here and executing it here you can see because the first value is one six nine nine it is giving you true and rest of them are false and similarly if i am executing this way it is giving you true for the column for the row where the mark price is 44950 what i want i want to know about the details of that product so what i'll do i'll open it here close it here and pass this whole list through the data frame and here you can see this is the product whose mark price is 44 950 and it is selling for just 26 970 it's not just it's a lot of money but yes it's giving almost 40 to 40 percent 40 to 50 percent of discount yeah and it's what is that it's a motion watch let this trap motion watch of unshock company the rating zero people have rated that product okay and if i want to know about that product just don't remove these links that we have added and then you can uh go to mandra and check the products as well okay so it's a watch of one size discounted amount how much uh amount we are discounting and it is giving you a discount of 40 percent okay and still this is not the product where which where you are getting maximum discount because this count is just 40 we have seen the products where we are getting even uh 75 80 discount this is not one of the products right so that's something you need to take care but if i'm talking about most expensive product this is the one okay and rather than writing it this i can also write the marked price is equal to is equals to our mark price dot max so you can see this is the product where we are having the maximum mark the price got it let's do one thing let's change some of the things from it and let's find rather than mark price discounted price okay most expensive product asked as per the discounted price do let me know in the chat what are the thing that i need to change do let me know in the chat what are the thing i need to change in this code to find the answer do let me know everyone quickly okay so uh how to register for the workshop this is already the link of the workshop that you are talking this is day two which is the last day of the workshop we are going to discuss about more things about uh what we are having but is the special offer we are having for you all these things will be there so stay tuned for that but just do let me know how to find the answers to it clear so what we are going to do because we want to find the most expensive product but not based on the mark price based on the discounted price so what i will do i take the data frame this time i will take discounted price copied and now if i am executing it so here you can see we are having a totally different thing and that's a woman every woman aviator of tom food so obviously that's going to be expensive so tom ford sunglasses are the most expensive this is the exact scenario that i have shown you earlier right there might be a product which is selling for more mark price is more but it's uh it's selling for way cheaper but if i'm talking about this because it's from four so it's mark price is forty thousand nine hundred it is discounted price is also the same size l sunglasses from down four zero discount zero percent discount and seller address is not mentioned sorted right so here you can see the products are totally different sorted now this is about the most expensive products if i'm talking about let's suppose most discounted products that's also a very important thing to find out right i'm hoping you are having clear understanding how we are finding the things okay so let's do one thing i'm trying to use the almost the same logic here okay so uh most this counted product in terms of percentage okay we are planning to find the most uh discounted product in terms of percentage so for that purpose what i need to do i need to take which column i need to take discount percentage column simple funda i need to find most discounted product that means i need to find the maximum value which is 90 okay so there might be multiple products uh in 90 percent in 90 bracket so what i'll do now i'm going to take the same thing here instead of discounted price i need to go for discounted percentage and now if i'm executing it here you can see we are having a lot of products where we are having 90 percent off the product price is 6099 but it is selling for just 609 rupees and all these products are from ritika this is the brand name and all of them are sarees and from here you can find a very very decent pattern and that is if i'm talking about the most discounted brand which is giving you the maximum discount this is ritika okay and this not one product because all the products are multiple products are having the same uh discount so this is what we are having here now not in terms of percentage let's talk about in terms of discount amount right for example if i'm talking about 100 rupees product a thousand rupees product it is selling for let's suppose 100 rupees so this count is 90 percent got it if i'm having product which is selling for let suppose uh and we are giving a discount of how many rupees the discount of uh 900 rupees is served got it this is the mark price this is the selling this is the discount and this is the final discount we are giving this is how much discount we are giving let's suppose the product is selling for 50 000 that's the marked price and it is selling for let's suppose uh 40 000 okay 50 000 product selling for 40 000 discount is 20 okay and it is of 10 000 rupees so from here you can see it doesn't matter how much percentage of discount we are adding it also depends how much uh how much is the actual price of the product right so what we are going to find out we are going to find out the product where you are getting the maximum discount not in terms of percentage but in terms of amount so that is something you will get from which column discount amount is that clear to everyone i'm hoping it's clear to everyone because it's no there's no rocket science we are just doing a simple thing but yes that will give you a lot of things and that's about this discount so i'm changing it to the markdown and here i take the f column i'll do all the things in the exact manner that the last question i am answering of this type and then we are going to discuss about another ones okay so i am taking discounted amount and if i am executing it this is a totally different product this is a totally different product not the most expensive okay not the most expensive in terms of mark price not most expensive in terms of decks uh but i would say discounted price but this is a totally different thing this is of brand name safari and what that product is the product is a trolley back marked as 32 000 selling for 90 9000 only 9 000 and discounted amount is 23 758 so this is a totally different product that's coming into you okay is it clear to everyone okay great so what we are going to do now we are going to discuss about some other columns that we can find out or we can analyze clear so for that purpose what i'm doing i'm taking same data frame again and this time i am going to dig deeper into the brand names not the numerical ones because we know how the numerical data is working we can find the median we can find the min we can find the maximum you can even find the products in a particular range like we are already having a range bar when we are searching for any uh e-commerce platform right you can write okay i want the product from let's suppose five thousand to seven thousand rupees you can add that bar that bar can also be added here pretty easily started so for example if i'm talking about the mark price let's talk about discounted price because that's something you are going to pay so let's suppose the discounted amount i am taking okay should be discounted price sorry it should be discounted price let's suppose i want to know about the product whose discounted price uh should be in the range of uh 2000 to 3000. so what i am writing should be greater than 2000 executed passing the whole thing through the data frame here you can see all the products whose prices specifically discounted price is more than 2000 sorted and let's see if i can write the same thing exactly here or i need to change some of the things okay so i think i need to change some of the things here so if i'm executing it this is telling you all the products with price more than two thousand okay and i am taking the pre-process data set if i'm printing df underscore pr this is the new data that we are having where the discounted price is more than two thousand i do the exact same thing here df underscore pr but this time i am taking the discounted price should be less than 3 thousand okay so here directly or indirectly we applied two filters okay and if i am printing df underscore pr these are all the products that are having range from 2000 to 3000 sorted if you want to find let's suppose only the products of h m in the range from 2000 to 3000 what you are going to do can anyone guess what you are going to do if you want to find the products of h m of price 2000 to 3 000 yes you guessed it correctly what we are going to do i am going to the same data frame i am going to apply one more filter into it and this time what i will do i will take brand name and brand name is equals to i take h and m stop it and now if i'm executing it here you can see we are having total of four products that comes under the price range of two thousand to three thousand and that is two thousand 2299 these are the four things we are having sorted and similarly if you don't want to go with h m and you want to search for handbags in the range of 2000 to 3000 so just take product tag is equal to handbags what we need to do let's instead of brand name we need to take product underscore tag execute it and here you can see these are all the products which are handbags okay and the range of the product is also exactly what you want between price 2000 to 3000 okay if you want to go with a particular brand for example back here i don't know how to pronounce this name but let's suppose you want to go with that as well you can even go for one more filter because we are just uh basically converging the data set into a particular point and finding the most important information that we want okay and here if you are talking about the brand name what could be the brand name let's suppose i want for bracket executed these are all the bags that are there in this particular range of 2000 to 3000 of discounted price okay not talking about marked price you know similarly if you want to sort them based on the discount okay if you want to sort them based on discount that's also something that can be done pretty easily for example this is the data frame i'm having i want to sort because here you can see i'm having one two three four five six seven eight products i want to sort them in terms of discount discount percent so these two products should be at the top so what i'm going to do i'm going to take bf underscore pr dot sort underscore values i am going to sort all the values by which column i want to sort all the values by discount percentage column executed here you can see all the discount discounted products are at the bottom why they are at the bottom they are at the bottom because by default the sort is in the ascending order we want it to be in the descending order so i am writing ascending is equals to false and here you can see this is the discounted product which are at the top similarly if you are having no issue okay now you think okay i don't want to go with uh only specific to baggett company i just want to search for the bags which are of price 2000 to 3000 based on the discounted price percentage okay and here you can see this back which is of actual 4495 rupees is now selling for 2000 rupees only and the discount is 55 50 and we are having at the last we are having the bags where we are having no any discount okay as per discount if i want to take only the top 10 products let's write dot head of 10 these are only the top 10 products based on this discount for 50 discount to 45 discount okay isn't it cool because now you if you are having the data set and if you can uh go with the links as well that's for some reasons i cannot show you uh the links but the things will be pretty easy you can make your own system right for example let's let's uh comment out your favorite uh brand name and but before that let me print all the brand names we are having in this digital in this data set and then you are going to ask me what are all the products what are all the brands you want to discuss uh what are all the brands you want to analyze so we are going to analyze those brands as well okay so for that part what i'm going to do i am taking this like this is how we can uh shortlist the product based on specific filter okay so let me add it here is the in the markdown so we are shortlisting the product based on a specific filter shortlisting products based on specific filters but it after shortlisting the product based on a specific filter this is the dataset that we are having and what we are going to do now i am going to add go to a next step which is 3.7 and here we are going to finding all the brand names okay we have to find what are all the brand names we are having started how many brands of uh how many brands we are having on on myntra as per this data set started now because we want to search about only the brand names how many such brands we are having so what i need to do i need to go back i need to take the data frame i need to take which i need to take the brand name column and this will tell you what are all the brands we are having sorted but this is not telling me how many unique brands we are having this is telling me okay this is the product of da milano and then there might be multiple products for damilano so what i'm going to do i'm going to write dot unique execute it and this is telling you all the unique products that we are having unique brands we are having okay this is an array let's check the length of array and here you can see we are having total 2139 unique brands here that's a huge number right 2139 brands are there so that's definitely whose number and what we need to do we are going to find how many products are there in each brand that is going to be a bit complicated to find but do we are having two ways to find it either we can go from scratch and find these values or we can go using inbuilt functions okay and we are going to do it in both the face sorted so let's start with the first one so if i'm taking let's suppose we have a brand name and resist of bran uh rather than going for brand name you can also go with a brand tag that would be uh a bit better okay because they are they are actually unique okay brand names are also unique but most of the time when we are working on the website and website is searching through it so it will use these kind of tags all of them are lowercase it will help uh google to also recognize when the uh website is being trolled so if i'm talking about brand name dot unique so these are all the brand names we are having but if i want to know uh how many uh products are there for green from green fiber brand how many products are there so what i am going to do i am going for i n bf of branding i will go for all the brands and i am going to check if that brand is equals to green fiber or not if that brand is green fiber i am going to increment the value of c by 1 okay and at the end what i will do i am going to print the brand name which is green fiber and c so if i'm executing it here you can see for green fiber i'm having 38 unique products for green fiber we are having 38 products right similarly for green for free so how many products are there let's find that out but i need to change i need to change only these two things for free so we are having 50 products for tamilano how many products are there let's find that out and for them we are having 26 products simple we are finding all the brand names once the brands are found we are founding how many products are there for a particular brand sorted now what i can do rather than finding da milano or let's take it as brand name okay and let's add here brand name as well and here i'll take brand underscore name is equals to let's start let's see career roots what i need to do all i need to do is change the name of the brand and rest of the things will be done by this okay so what i am doing i am going to define all these things in what in a particular function i can do that pretty easily right so i can define a function uh that will help you to find all the unique values okay that also can be done but let's do it in a very easy manner so here you can see if i'm changing this fiber this brand name all the time in auto mode if this thing can be done all of these things will be pretty easy to find that out okay like for example i can found if i uh like if i'm talking about fever how many uh products are there of fever company how many products are there uh properly uh h m or zara or whatever product you want so what i'm going to do i'm going to take for brand underscore name in bf of brand name of unique now what will happen it will go to all the brands and print the values started so it will it might take a couple of uh seconds to execute but if i'm executing it here you can see for green field it's 38. for free sold it's 50 for dow milano's 26 products for material it's 67 for indoor rights 137 products okay for hrx it's 288 products from jack and john's 173 right and once we are having this data you can see the possibility what you want right you can easily find which uh companies having most product which companies having leased product you can even shortlist these things which company is having the max uh expensive product which company is having uh least expensive products these are the kind of things that can be easily treated sorted so and again asking you if and you guys want anything to be analyzed you can you can tell me straight away okay we are going to dig deeper into that part started so once we having this data what would you like from it so i can take this data save it in a list then we can create a data frame and then we can sort the values based on whatever we want okay and let's do that so i'm taking a list named as data and here i'm taking data dot event simple i'm passing a list of two things brand name and how many products are there from that brand sorted if i'm executing it and printing data or let's do one thing let's create a data frame from it directly data is equal to pv dot data frame the data frame will have two things for all the products the product name and how many products are there for that particular brand so here i am taking the whole data column i am defining two columns here and these columns are first of all the brand name and the brand products but if i'm having this data so i'm writing data dot head okay we need to wait for a couple of seconds so that it will be executed because we are having literally all more than 2000 products this is what the data frame we are having now this is the new data frame we have created okay and this data frame is having 2139 brands what i want now let's suppose i want finding all the brand name that's easy okay now we are finding uh 3.8 finding the products uh the brands with most number of products okay finding the band with most number of products so for that purpose this is the data frame we are having now i can sort this thing pretty easily the same logic that we have applied here of sorting the values now we need to sort the values by what by bit factor by products and that should be in which order descending order so ascending is equal to false so if i'm executing it if i'm talking about rooster 633 products a very big number master harbor 369 product dressberry 311 product 311 products so if i'm talking about finding the brand with most finding the top 10 brand with the most number of products there so what are the top 10 products if i'm printing dot head and let's add all the things here on it will take couple of seconds to execute because it is doing all the processing again but these are the top 10 products we are talking about so it is number one it's rootster martian hardware address here and now max and these are the top 10 products if we are talking about in terms of number of products sorted no rocket science now let's see how we can do the exact same thing literally exact same things using one line of code okay and that can be achieved using something called as group by okay we can use group by functions okay so i am going to use bf dot group by on that data frame that we are having on the original data frame we are going to make the groups okay and uh i am going to make the group based on what the brand name so here i am defining brand name so what it will do it will take the brand name all the unique brand names we are having and it is going to group them together okay after grouping them together what do we want to analyze you want to analyze how many products are there in each brand right and nothing and for that purpose to find that thing we are using something called as dot size means it will make the groups of each and every brand and check the size of each brand and size is nothing but means how many products are there in that brand so now if i'm executing it here you can see this is what the data looks okay and here you can write sort underscore values execute it this is what you are having and here i am writing ascending is equals to false and here you can see this is what we are getting and if i want the top 10 of them this is the exact data we are having the output is exactly the same here we have written the whole logic to find the things but here the things can be achieved only in one line but this will tell you how to write your own logic to find the answers is it clear to everyone yeah that's great so now what should be the next step because we have came so far so now let's suppose rather than going for just one thing at a time okay or basically just the products what if i want to know about uh all the average price of all the products okay so this is finding the top brands and now we are going to find let me add the things here and this is question 3.9 finding the most expensive plants finding the top okay so we are going to find the top and most expensive ramps so what so how you can identify but this is an expensive brand and this is not an expensive brand so to find expensive brand uh what we will do we will find the average price of a product in that particular brand right for example if i am uh talking about max okay so max if i'm talking about the average t-shirt price in max so that would be around let's suppose 500 rupees if i'm comparing the same uh to uh as compared to let's suppose in editors that is around four to five thousand right if i'm comparing the same uh to a brand like gucci so that would be around 40 to 50 000 on an average right so the average product price will determine how expensive that product is simple funda so what we are going to do we are going to take the average price of that particular product okay for example if i'm going to uh h m so on h m i will find how many products are there while find i'll calculate all the prices i'll find the average price of that particular brand and that will tell me okay this is the average price of that particular brand let's suppose average price of that particular brand is uh 2000 so and average price of max is just one thousand so you can compare h m is more expensive than max simple logic we are going to apply and we are not going to write any uh function from sketch we are going to use inbuilt function because you know how the things can be done pretty easily now because you know how the logics are built so what i am going to do i am going to take the brand names i am going to make the uh groups but this time i am not going to make the groups based on how many products are there i am going to make the groups on the average price of the product and in that particular case you are having two kind of prices you can out either create marked price or crate discounted price okay mostly mark price is something that is going to be taken okay so let's take marked price i am going to make the marked underscore price i will take brand name for every brand i am going to make uh i want to find how many products are there i am going to make different groups for all those different groups i am going to find their marked price and i'll find the average marked price of them sorted that's how easy it is execute it and here you can see the answer in front of you right for 39 threads the average price of product is 965 rupee right for yoho it's 699 rupee for zebra it's 1098 rupee okay and you can even uh go in detail if you want to go for let's suppose apply this uh apply this filter for only the products where we are having shirts so you can go for only the shirts column then you can find how many different uh different brands we are having and then we can calculate okay what's the average price but this is what we are having i can sort them basically sort the values uh and ascending should be false the top and most expensive brands are onshore tom ford and dyson t-shot as well and that's pretty awesome because they are actually the one of the most expensive brands right tom ford do you know that also you know you have you might have seen their watches if you are not just go check it out so this this is our finding the top most expensive brands this is how we have found that okay and let's check if i'm copying this and pasting it here instead of marked price but if i'm using a discounted price i'm just doing it to check if we are having a different answer in this case or not okay and let's write dot head of how many brands 10 these are the top 10 brand safari armani psycho and these are actually expensive brands and here as well i'm writing head off top comfort dyson here you can see on saw is at the bottom but most of the product are the same if i'm talking about tom ford dyson desot they are the same okay michael core is here cole haan is here impuri or money is here here you can see we are not having here but if you are checking the top 20 brands they will remain the same okay so this is how we are finding the top 10 most expensive brand top 10 uh most expensive brand instead of terms of mark price and discounted price okay now let's find the thing that we have done here okay so here if i am talking about applying the filter or brand name what is the average discount a particular brand has given is giving so erithika here you can see is giving a discount of 90 right so this will also tell you which brand is giving you on an average of how much discount so you can found you can find which brand is most discounted and similarly we are also going to find what is the average rating of a particular product you know in that particular brand okay so let's jump into the brand as compared to their discount percentage okay so to do that the logic will remain almost the same all we need to do is take the marked price values instead of marked price i take discounted discount percent where you can see ritika is the one which is giving you 89.45 you might be thinking it should be 90 percent why it is 89 because there might be some products of ritika where they are not giving 90 percent discount there might be 85 right so 85 and ah so the average would be somewhere around 89 percent and that is something we are getting here okay so rithika is giving 89 discount the app studio exactly 89 okay and these are all the brands we are having which is giving you the most discount similarly if you want that is the brand which are not at all giving you any discount so these are the brands okay and this i don't need to tell you about this brand bobby brown is there mac is here okay and i don't know how to pronounce rest of them yeah so this is how you can find these things pretty easy no rocket science and these are the brands they are not giving any discount they are the brand which are giving the discount now we need to find brands which are going to give you uh means we need to find uh the average rating of the products in that particular brand okay so because we need to talk about the average rating on that particular brand so for that purpose we are having three things to deal with okay so first of all if i am directly uh applying this particular the same logic here okay so then there will be some problems okay if i'm directly applying it there will be some problem and let me tell you what those problems are going to be okay so if i'm taking this one and i am talking about the mean relating okay if i'm talking about me rating and execute it this is telling you the average rating so here you can see for 39 threads the average rating is zero percent right for for 47 four four seven eleven it's zero again okay and for yellow it's four point one five for you it's zero again okay it might have it it is happening because there are a couple of brands who are having the block products and those products are not rated right so in that particular case what i need to do i am only going to take the brands where i am having the ratings of the product okay and for that in that particular case what i do rather than doing it directly i take b of underscore p r or d f of b f of a rating is not equals to 0.0 so this this is how we need to return okay so here you can see these are all the products whose rating is non-zero and if the rating is non-zero then on this particular data set i can do the processing okay so i'm taking df underscore pr and on this particular data set i'm going to do the rest of the things i'm going to take the brand name i'm going to find the rating average now if i'm executing it this is how the data looks and now i'm going to write sort underscore values i ah not buy but ascending is equal to false so here you can see london shirt theory these are the brands where the rating is five right there might be only one or two people who have given the rating but as per the rating this is what we are having yeah and if i want to know about the same thing exact same thing but based on the rating count how many people have rated that product and the rating for that purpose i am taking all the products where we are having rating more than more than zero means even if one rating is there that's totally fine and we are going to find how many uh as per the number of ratings so i am taking the rating count and here you can see for nv we are having nine thousand people purchase the product from nv and then given the rating from jaguar 6953 people for plum these are the ones right from maybelline it's 5058. so the numbers are huge right it totally depends upon you how you are finding those things sorted now one last question that we are going to discuss and that is about the address very very important thing okay and we are going to i'm going to tell you uh how the things can be uh and this is a part of data preprocessing by the way yeah so let's jump into it and for that purpose i am taking what df of seller address so if i'm executing it here you can see we are having a lot of seller addresses if i'm taking zeroth one which is the address of the first seller okay from is the address of second channel from karnataka now let's do one thing let's print some of the let's print first 20 of them let's print first okay i think i need to print it one by one for indf getting a first 10 and uh so these are all the addresses we are having there is one thing common in all the addresses and that is at the end we are having pin code sorted here you can see here as well here as well at the end we are having pin code sorted and if uh that's the common thing and the second last thing is from this state that belong to the product is coming karnataka delhi gujarat gujarat again west bengal punjab maharashtra swath again so what we are going to do we are going to create new columns that will tell you exactly from where that product is coming the state from where it is coming as well as the pin code so i'm going to create two new columns which will help you okay if this is the uh data set that we are having and for this particular data set if these are all the uh for this particular product if this is coming from this particular location how many other products are there coming from the same location these are the kind of things that you can easily do okay so because this is the last question so so this is a part of data pre-processing here and to do the data preprocessing what i need to do i am going to split them all of them with a space if i'm splitting them with a space this will give you a list this is also giving you a list this is another list and in in all the list the last index will give you the exact pin code so after splitting it i am taking minus one and this is the pin code of from where the product is coming okay so what i can do i can take pin code is equals to a list and i am going to take this whole thing as pin code pin code is equal to this one okay so if i'm executing and printing pin code these are all the ping codes we are having sorted no rocket science so what i am going to do now i am going to print i dot split again or let's print i these are all the products let's suppose i also want to know about the state because in one state there might be hundreds of pin codes so to find the state i need to again split it with the space there might be there are multiple ways to do it but let's take it with the space so if i'm going by the space last index will give you pin code before that there's a separator before that you are having the state so that means minus 3 will work here and here you can see these are all the products we are having here you can see we are having best bengal written i think it's fist bum bengal so this is this will give you definitely a problem so output should be uh where is that west bengal but we are taking only bengal so let's do one thing let's separate it with the comma this comma okay so i starts related with the comma and after splitting it with the comma i take the last index okay because here the last index is giving you gujarat pin code karnataka pin code pin code west bengal pin code i'll take the last index which is -1 and for all of them i'm going to now split it with this particular separator dot split it with this separator and now it takes 0th index and here you can see we are having some extra spaces written here you can see there is an extra space so i am going to write dot ship so that all the extra spaces will be removed and this is nothing but the state at the whole thing st dot of bank street is equals to this whole thing okay and here if i'm printing in code and state here you can see these are the things that we have scrapped and you can also scrap the rest of the details from this whole data that we have from for example if you are having the pin code you are having the detail you can also find the rest of the address from here from this state this is you can also search the whole link on google uh and see okay if it is found here what is the longitudinal relativity of it you can plot these things on maps using data visualization the possibilities are literally endless it's totally up to you how you are tackling this problem how you are dealing with this okay so yes that is pretty much it and ah now let me tell you how to deal with this if you are having all of the things here so if i am executing for all of them it will give you an error lets see if it is giving an error or not i am executing for all of them it is not giving another okay let's check df of seller address executed and let's check the description of it dot describe so here you can see the top one is from the second floor this particular plot number who is having the frequency of 1872 that is huge because this is nothing but telling you that this particular from this particular address there are 1872 products coming in right and it's from okra industrial so this is something we are going to find out you can easily found out using the logic of seller address we can apply uh make the brands of group but let's make it here because i think that that is pretty that's pretty awesome to find it so we'll find it dot uh with dot size right sort the values instead of brand name it should be seller address underscore a wd r so now if i'm executing it if the sending is equals to true ascending is equal to false sorry we want only the top later those five of them here you can see this is exactly what we want second floor plot number 82 oakland industrial state new delhi and this is the number one where we are having 1872 different products listed on mantra that's a huge business right and we are having note mentioned for 1445 products these there are 1445 products whose address i don't know so that's also valid point but for those we are having the address the numbers are huge 1072 is a huge inventory right and once we have in these two things what i'm going to do i'm going to take these things let's see if it is this is only valid if it is not mentioned okay so let's find that out that if i is not equal to not mentioned then i will perform these two things okay otherwise what i will do in pin code i write np dot none i am importing numpy as in p otherwise this is done and the state is also np dot none but it so we are adding null values if you are not having state so this is how we need to deal with it started and once everything is done i am taking the original data frame and in the original data frame and adding a new column index pin code which is the whole pin code we are having and df of uh the state from this state that provider is coming in let's turn it execute it and let's print the data frame now so now if i'm printing the data for images the final data frame at the end here you can see we are having a pin code and we are having state once you are having pin coded state you can easily apply all those logic that we are having like pin code of size and this will tell you from this particular pin code we are having 24 000 okay i think i have split the whole thing with the with one particular index i think for i in seller address we are splitting i i is not equal to mentioned so i think all of the products are giving the same value i think there is something that i need to change as for the logic and not so it is pin code here it is again a list then pin code is empty list i am adding all the values here otherwise pin code is equals to actually it is a list so i need to write pinko dot append i need to find the data here stay dot append i need to append the data here right append again and here is the line into right dot up now i'm executing and printing the data here you can see that's the pin code from gujarat karnataka delhi and now if i'm based on the size if i'm sorting it there are 2000 product from coming from this particular pin code okay similarly if i'm talking about the state there are 8 000 product coming from delhi from karnataka 3000 product from haryana 2 600 products and you can make different kind of plots from this data set okay the possibilities are literally endless thanks for adding a pen that's what i have missed so the possibilities are endless as i've told you now let's discuss about what should be the next step because we have analyzed this data set this is a real-life data that we have extracted uh that we have script and this this can solve a lot of purpose you can add the links of the product the data set link is already given in the description you can check that out and to learn this thing to learn the skills of data science this is just one module that we have discussed that is data analysis okay and then just here you can see in just one hour 20 minutes where we have missed 10 to 15 minutes only on the audio uh for the audio issue and then you can see the possibilities okay in just one hour if you learn these many things just see if we are having a whole six months program in your hand what are the things that you can learn from end to end okay the links uh of the whole program that we are having so that's the selfies program including live lectures we are having of the mentors on weekly uh basis where you are going to interact with mentor life we are we are going to learn from them right and this program that we have i'm going to take you to let me take you to uh the program page only so okay so this is the complete data science program we are having which is starting uh means the offer is valid uh for only uh on 31st july means tonight and we are giving a flat uh we are giving this course for flat 5000 rupees and uh now you're having clear understand what is the difference between uh mark price discounted price right because we have done a lot of things on myntra this time so we are giving a discount of flat uh uh on on this course we are giving for flat 5000 rupees and this course is divided into multiple tracks starting from the one where we are teaching you the python for data science even if you know zero if you are having zero knowledge in any programming language you can start okay we are teaching you from the fundamentals of python data structure how you can automate the process using files how you can create a data set from scratch uh how to uh learn the art of numpy arrays how to visualize the multi-dimensional list and how to work on it okay because now today only we have discussed how to write your own logics okay then we are the things that we have discussed today how to work on data analysis okay this time we are having a very good data set we are not having any value so we know how to work with it but if we are having null values things will be very very problematic okay so once we're having this data set we we can work on it and the next part how to create the data sets if you are not having the data set what to do how to create these kind of data that is just created that is a part of web scrapping okay so we have also discussed this very important part there okay then once you're having all the things ready how to create machine learning models that can help you to recommend the products based on your needs let's suppose if you are liking these kind of products so it will recommend you the same kind of products right this is just one application and you know the possibilities of machine learning it's endless then we are having machine learning uh then we having image processing computer vision deep learning there are we this is going to be the only course that you need to enroll for to learn data science right and uh yes you can register for it as i have told you uh rpgen is one of the mentor there uh who is going to interact with you and this is going to be uh in both the ways okay you are going to have the recorded lectures you are going to have the live lectures on weekly basis so that you can interact with the mentor and you are going to build those projects like you know so rpg who has taken uh your lectures yesterday is going to be the mentor where we are having multiple other mentors as well uh who are working in the industries of uh data science of ai in ml from last couple of years and here you can see uh this is like discounted for only five five thousand rupees now okay and the offer is valid uh so till tonight so yes the offer closes soon and yes that's pretty much it about uh the whole program that we are having so thank you so much everyone uh okay so sumi somebody's saying when you are going to bring the data set that requires edu okay so for for those kind of problems as well we are going to have the um we are going to have these kind of sessions really soon uh okay where we are going to perform different because so far we have discussed about data pre-processing okay and data analysis how we can do data visualization how we can great build end-to-end models in machine learning all these kind of things are yet to come and we are also having the same things on our premium course as well that the link to the course given in the description you can find all the support links either from this data set or the notebook that we have created the codes that we have written is also something i'm going to upload it and just when the session ends and you can find all those things also on the github uh you can go for the gita plug okay so yes so we get the internship certificate for this course okay you will get the course certificate not the uh not the uh internship certificate because this is uh a data science program not the internship program okay so that's pretty much it thank you so much everyone uh and i'll see you in some other day and if you like these kind of session just give it a like and subscribe to the channel if you want to know more such session do let me know in the comments and thank you so much bye you
Original Description
In this workshop, Ashish Jangra will give a complete data analysis of Myntra.
🏆 Explore Geek-O-Lympics 2022: https://www.geeksforgeeks.org/geek-o-lympics/?utm_source=youtube&utm_medium=courseteam_main_desc&utm_campaign=geek_o_lympics
📝 Data Structures and Algorithms - Self Paced: https://practice.geeksforgeeks.org/courses/dsa-self-paced?utm_source=youtube&utm_medium=courseteam_main_desc&utm_campaign=geek_o_lympics
📖 Check out more of our courses: https://practice.geeksforgeeks.org/courses?utm_source=youtube&utm_medium=courseteam_main_desc&utm_campaign=geek_o_lympics
---------------------------------------------------------------------------
Code Link: https://github.com/AshishJangra27/Myntra-Data-Analysis
Connect with Ashish -
LinkedIn: https://www.linkedin.com/in/ashish-jangra/
Kaggle: https://www.kaggle.com/ashishjangra27/
Github: https://github.com/AshishJangra27
---------------------------------------------------------------------------
Follow On Our Other Social Media Handles:
📱 Twitter: https://twitter.com/geeksforgeeks
📝 LinkedIn: https://www.linkedin.com/company/geeksforgeeks
🌐 Facebook: https://www.facebook.com/geeksforgeeks.org
📷 Instagram: https://www.instagram.com/geeks_for_geeks
👽 Reddit: https://www.reddit.com/user/geeksforgeeks
💬 Telegram: https://t.me/s/geeksforgeeks_official
#geeksforgeeks #coding #gfg #dataanalysis #myntra #python
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from GeeksforGeeks · GeeksforGeeks · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
How I got into Walmart | Shailesh Sharma
GeeksforGeeks
Upgrade yourself In 29 Days | GeeksforGeeks
GeeksforGeeks
Learn AWS Fundamentals For Free
GeeksforGeeks
Conversation With Young Achievers | Meet the winners of Bi-Wizard Coding Contest | GeeksforGeeks
GeeksforGeeks
Meet The Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
GeeksforGeeks
Interview Prep Strategies | PayPal
GeeksforGeeks
OLX Interview Preparation Strategies | Hukam Singh
GeeksforGeeks
Meet Some More Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Microsoft Azure For Absolute Beginners
GeeksforGeeks
Python for Data Science | Data Science Master Bootcamp | Arpit Jain
GeeksforGeeks
Getting Started with Data Analysis | Data Science Master Bootcamp | Ashish Jangra
GeeksforGeeks
How to prepare theory subjects for SDE interviews | Geeks Summer Carnival 2022
GeeksforGeeks
Get Your Tickets To The Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
TED Talk Data Analysis Project | Data Science Master Bootcamp | Ashish Jangra
GeeksforGeeks
How I Secured AIR 9 in GATE'22 | Tushar
GeeksforGeeks
Learn Java Backend Development | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
How to Recognize which Data Structure to use in a question | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
Learn Data Structures and Algorithms | GeeksforGeeks
GeeksforGeeks
Interview experience at Flipkart | GeeksforGeeks
GeeksforGeeks
Lets Prepare for GATE'23 the Right Way | Sakshi Singhal | GeekSummerCarnival
GeeksforGeeks
Highest Paying Jobs in 2022 | Ishan Sharma | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Geeks Summer Carnival 2022 | 5th April- 11th April | GeeksforGeeks
GeeksforGeeks
Preparing for SDE interviews | Soham Mukherjee | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Full Stack Development with React & Node | Utkarsh Malik | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
Introduction to Open Source and Roadmap to GSOC 2022 | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Web Scraping in Action | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Getting Hired at BITCS via GfG Job Portal | Get Hired With GeeksforGeeks
GeeksforGeeks
How to build a faster landing Page | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Geeks Summer Carnival | 5th To 11th April, 2022 | GeeksforGeeks
GeeksforGeeks
How to get ideas for Startup | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Journey from Tier 3 to JusPay | GeeksforGeeks
GeeksforGeeks
Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Dispelling Myths and Pre conceptions of Programming Languages
GeeksforGeeks
Must Do System Design Questions
GeeksforGeeks
Understanding Sorting Techniques in an hour | Keerti Purswani | Geeks Summer Carnival
GeeksforGeeks
Get Hired at NEC | Job-A-Thon 8
GeeksforGeeks
Journey from Tier 3 college to Microsoft | GeeksforGeeks
GeeksforGeeks
Get Hired with GeeksforGeeks at SuperK | Job A Thon 8
GeeksforGeeks
GeeksforGeeks: Redesigned
GeeksforGeeks
From Tier 3 to cracking multiple interviews | GeeksforGeeks
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Youtube Data Analysis | Ashish Jangra | GeeksforGeeks
GeeksforGeeks
DSA Self-Paced Course Preview | Sandeep Jain | GeeksforGeeks
GeeksforGeeks
GATE Live Classes | Prepare for GATE CS 2023 | GeeksforGeeks
GeeksforGeeks
Journey from JIIT to Adobe
GeeksforGeeks
Life Is Unfair Ft. Shonty badmash | LIVE Discord Session | A GeeksforGeeks Exclusive
GeeksforGeeks
Interview Experience at Google | Tech Dose
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Interview Experience @ Amazon | GeeksforGeeks
GeeksforGeeks
My journey through the tech world from India to US | Vidushi | GeeksforGeeks
GeeksforGeeks
Complete Interview Preparation Course | GeeksforGeeks
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Getting Hired at FiftyFive Technologies | Job-a-thon 9.0
GeeksforGeeks
GFG Karlo, Ho Jayega | GeeksforGeeks ft. Khaleel Ahmed
GeeksforGeeks
How I got job offers from 2 big companies : Arcesium & Microsoft | GeeksforGeeks
GeeksforGeeks
LINUX for Beginners | GFG x Itversity
GeeksforGeeks
My interview experience at Walmart | GeeksforGeeks
GeeksforGeeks
Get Hired at Speckyfox
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
More on: Data Literacy
View skill →Related Reads
📰
📰
📰
📰
O(N) Manacher's Algorithm with Mirror Boundary Optimization
Dev.to · Dipaditya Das
Building a Power Grid Inside Minecraft with BFS Algorithms
Dev.to · Carlos Cortez 🇵🇪 [AWS Hero]
The Run-Length Encoding Trick: How Simple Strings Get Compressed
Medium · Programming
75 Days of Leetcode — Day 4: #238 — Product of Array Except Self
Medium · AI
🎓
Tutor Explanation
DeepCamp AI