0

i got a 'Category Col' which looks like this:

Category Computers/Tablets & Networking 1611 Video Games & Consoles 1502 Jewelry & Watches 686 Home & Garden 677 Clothing, Shoes & Accessories 666 Sporting Goods 427 Toys & Hobbies 406 Sports Mem, Cards & Fan Shop 344 Health & Beauty 343 Movies & TV 325 Music 317 Art 285 Cameras & Photo 82 Consumer Electronics 69 Stamps 68 Musical Instruments & Gear 37 Business & Industrial 31 Collezionismo 29 Collectibles 14 Crafts 12 Specialty Services 8 Cell Phones & Accessories 7 eBay Motors 7 Sammeln & Seltenes 5 Collections 3 Vehicle Parts & Accessories 3 Collectables 2 Jouets et jeux 2 Deportes 2 Industrial 2 Everything Else 1 Books & Magazines 1 Giocattoli e modellismo 1 Dolls & Bears 1 Jewellery & Watches 1 Timbres 1 Orologi e gioielli 1 Home, Furniture & DIY 1 Motor: piezas y accesorios 1 Computer, Tablets & Netzwerk 1 Garden & Patio 1 Name: Category, dtype: int64

I Want to create a new data col of the top 5 of the cat here, which is: ['Computers/Tablets & Networking', 'Video Games & Consoles', 'Jewelry & Watches', 'Home & Garden', 'Clothing, Shoes & Accessories', 'Sporting Goods']

I did this: new_df = all_data['Category'].value_counts()[:6].index.tolist()

But its take only the names of the cat, and not the whole data inside... how i can create df with all the data ?

OmerB
  • 19
  • 4

0 Answers0