Reputation: 163
I want to filter the Market Cap column to only show data above 40,000,000 and delete the rest but Im getting an error each time I try the usual column filtring methods.
TypeError: '<=' not supported between instances of 'str' and 'int'
df = df.set_index('Symbol')
df = df.dropna(how='all').dropna()
df['MarketCap'] = df['MarketCap'].apply(lambda x: '{:.2f}'.format(x))
df["MarketCap"] <= 40000000
Upvotes: 0
Views: 62