I want to format my "VOLUME" column the same way like the "MKT CAP" column with prefixes.
Prefixes like "M" for 10^6 or "k" for 10^3
I used the numerize library for this but need help to make it work for formatting the whole VOLUME column.
import pandas as pd
from numerize import numerize
df = pd.read_html('https://www.tradingview.com/markets/stocks-usa/market-movers-pre-market-gainers')[0]
df.columns =['TICKER', 'CLOSE', 'PRE-MKT CHG', 'CHG %', 'VOLUME', 'PRE-MKT GAP %', 'PRICE', 'CHG1 %', 'VOL', 'MKT CAP']
df = df.reindex(columns=['TICKER', 'CHG %', 'VOLUME', 'MKT CAP', 'CLOSE'])
df['VOLUME'] =df[numerize.numerize(df['VOLUME'])] #this line did not work
Also how can i filter out the first letter and space for only the yellow marked cells? There needs to be a filter looking for a space and also remove the first letter.
