I have created a Dictionary of small Dataframes from one large Dataframe by grouping them based on a column value using;
dict1 = {k: v for k, v in df.groupby('Some Column Name')}
I want to pass these to a second Dictionary and drop Dataframes based on the number of rows in them. For example, any Dataframes with less than 20 rows should be ignored.
I can drop them based on values like this but can't find a way to reference the row numbers directly;
dict2 = {k: v for k, v in dict1.items() if v[0] <=20}
Any help is appreciatted, thanks.