I have Value of Energy Cost Saving Program dataset
And I want to answer this question: Considering only NTAs with at least 5 listed businesses, what is the average total savings and the total jobs created for each NTA?
So I used the following code for the first parts:
df['NTA_mod']=df['NTA'].str.split('-')
df=df.explode('NTA_mod').reset_index(drop=True)
df_NTA_grp=df.groupby(['NTA_mod'])
now I have to pick those with NTA greater than 5 and I used following code
df.groupby('NTA_mod').filter(lambda x: len(x) >= 5)
However, I don't get any response and I don't know how to continue to answer the question. How should I pick those NTA with businesses with at least 5 businesses? is my approach correct? If yes now how should I aggregate to get mean and sum for next step?