The best is use if possible parameters in read_csv
:
df = pd.read_csv(file, thousands=".", decimal=",")
If not possible, then replace
should help:
df['col2'] = (df['col2'].replace('\.','', regex=True)
.replace(',','.', regex=True)
.astype(float))