I am trying to change data_df
which is type float64
to int
.
data_df['grade'] = data_df['grade'].astype(int)
I get the following error.
invalid literal for int() with base 10: '17.44'
From:
data_df['grade'] = data_df['grade'].astype(int)
Need to change int into 'int'
data_df['grade'] = data_df['grade'].astype('int')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With