i can use mean and median with groupby with this line:
newdf.groupby('dropoff_site')['load_weight'].mean()
newdf.groupby('dropoff_site')['load_weight'].median()
But when i use it for mode like this:
newdf.groupby('dropoff_site')['load_weight'].mode()
An error popped up, saying: 'SeriesGroupBy' object has no attribute 'mode'
What should i do?
update: from GroupBy pandas DataFrame and select most common value i used
source2.groupby(['Country','City'])['Short name'].agg(pd.Series.mode)
as
newdf.groupby(['dropoff_site'])['load_weight'].agg(pd.Series.mode)
because this has multimodal, but now the error goes: Must produce aggregated value