Attribute
count
Crop Type Harvest Season
Barley Spring 25
Corn (Grain) Spring 655
Winter 1
Corn (Silage) Spring 6
Cotton Spring 5
Peas Spring 3
Canola Spring 169
Winter 164
Soybeans Spring 541
Winter 2
Sugar beet Spring 82
Sunflower Spring 637
Winter 1
Wheat Spring 253
Winter 451
I have a dataframe df
where I counted the number of each group based on the foll. code:
df[['Crop Type', 'Harvest Season']].groupby(['Crop Type', 'Harvest Season']).agg(['count'])
The output of this code is the dataframe above.
How can I exclude groups from the original dataframe where the count is less than 30?