text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt

avo['Month'] = avo['Date'].apply(lambda x: x.month)
avo.groupby('Month').mean()['AveragePrice'].sort_values(ascending=False).index[0]

avo.drop(avo.loc[avo['region'] == 'TotalUS'].index, inplace=True)
avo.groupby('region').sum()['Total Volume']

avo.groupby('region').sum()['Total Volume'].idxmax()

plt.figure(figsize=(12, 5))
avo.drop(avo.loc[avo['region'] == 'TotalUS'].index, inplace=True)
avo.groupby('region').sum()['Total Volume'].sort_values().plot.bar()