Pandas making a new list from groupby object

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Pandas making a new list from groupby object



My data has a country column and 'Clicked on Ad' column which has boolean value for customers preference for ad. I want to groupby my list to see the number of clicks based on countries. Then I want to cut (4,8) clicks which represent highest clicks per country. I want to cut these rows and create a new list while keeping all features of rows


ad_country=ad_data.groupby('Country')
Country_sum=
for i in range(4,8):
if ad_country['Clicked on Ad']==i:
Country_sum.append(iloc[ad_country])





Please show a sample of your data and the output expected.
– coldspeed
19 secs ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard