wrong result shown in converting float to integer in pd

Viewed 23

pandas

hi i want to ask why i convert to int but the result still remain as float64

1 Answers

As shown in the pandas docs, the method returns a new DataFrame. This means that you want to store the result in the variable df_cleaned to override the previous value:

df_cleaned = df_cleaned.convert_dtypes(convert_integer=True)
Related