I want a pandas dataframe to group by a column named 'ad_id', each entry in this column is an integer, for example, 7, 12, 120003, 12, 7. When I groupby, python seems messed up with the integer, instead of showing me 7,12, 120003, it just showed me 1,2,3. Why does that happend?
Initial dataframe:
Here's my code:
ads_df = pd.read_csv('clicks.csv')
each_ad_counts= ads_df.groupby('ad_id').size()
each_ad_click_counts= ads_df.groupby('ad_id')['clicked'].sum()
After groupby:
But in the original dataframe, there is not ad_id as 1 or 2 or 3