GonVas / tickerrain

Website that displays in real time tickers being processed by different sources.
MIT License
179 stars 56 forks source link

Tickers initial selection #7

Open PaoloLeonard opened 3 years ago

PaoloLeonard commented 3 years ago

Bug explanation

There is a small bug when you first filter the tickers by Market Cap. As it stands, you do not remove the nan values from the tickers dataframe.

Now

for index, row in tickers_pd.iterrows():
    if(row['Market Cap'] < 300_000_000):
        tickers_pd = tickers_pd.drop(index)

Fix

tickers_pd = tickers_pd.loc[tickers_pd['Market Cap'] > 300_000_000]

The fix is also faster than the current for-loop.