I have a dataframe like this:
A B C
15 'ds' ' 0.000'
32 'ds' ' 1.000'
56 'ds' ' 2,700.000'
45 'gb' ' 7.000'
I want to change the values of column C
to integers; so what i'm doing is something like this:
df.loc[:,'C'] = df.loc[:,'C'].apply(lambda x: int(float(x.strip().replace(',',''))))
This do the job, however, i get that annoying SettingWithCopyWarning
. Why this appear if i'm using loc
?