Need some help on processing data inside a pandas dataframe I want to convert the form of "col1" into the form of "col2", what should I do?
import pandas as pd
a = {'col1' : ['0.11K','1011K','0.12M','0','0.3','0.02'],'col2':['110','1011000','120000','0','300000','20000']}
df = pd.DataFrame(a , columns=['col1','col2'])
df['col'] = (df['col'].replace(r'[KM]+$', '', regex=True).astype(float) * \
df['col'].str.extract(r'[\d\.]+([KM]+)', expand=False).fillna(1).replace(['K','M'],[10**3,10**6]).astype(int))