This is my DataFrame:
d = {\'col1\': [\'sku 1.1\', \'sku 1.2\', \'sku 1.3\'], \'col2\': [\'9.876.543,21\', 654, \'321,01\']} df = pd.DataFrame(data=d) df
The best is use if possible parameters in read_csv:
df = pd.read_csv(file, thousands='.', decimal=',')
If not possible, then replace should help:
replace
df['col2'] = (df['col2'].replace('\.','', regex=True) .replace(',','.', regex=True) .astype(float))