I'm noob in python. I have a dataframe with prices of a bunch of assets in NSE (National Stock Exchange of India). Now i need to filter those assets that contain a certain number of observations. It's a liquidity filter. Each column represents an asset. The index of dataframe is datetime. There are 2462 rows, so 2462 days of observations (since i got daily prices), but not for all assets, and that's why i need to filter my dataframe.
I tried to apply a groupby.filter but that's not working. I'm thinking in a for iteration using len() for each column. Can i do this?
This is a little example. The original dataframe have more assets.
Date (Index) | Asset 1 |
---|---|
2010-01-01 | 180 |
2010-01-02 | 181 |
My data goes from 2010-01-01 to 2020-01-01 so i need to pick those assets that had liquidity in all the 2462 rows. Instead of choosing manually the dates, i need to build a filter to selecting those assets and creating a new dataframe after the filter.