How to filter

print (mp.groupby('Sector').filter(lambda x: len(x)>= 3))    



This will return sector with 3 or more than 3 companies



How should I filter companies based on amount invested (e.g invested > 15000) grouped by Sector or MarketCap ?

 

Hi Saurabh,



Hope this is what you are looking for:



print mp[mp['Amount Invested']>15000].groupby('MarketCap').filter(lambda x: len(x)>0)