pass float data from a column to int

1

I need to make a boxplot of a column called age, as the dataset assumes this with most of the data in wrong format. replace the NaN data to 0, but the .float persists, which I must also pass to int, to graph them. try with this code

data_tres[['age']] = data_tres[['age']].astype(int)

data_tres['age'].dtypes

but it does not work !!!!!

this is the error that throws:

  

ValueError: can not convert float NaN to integer

Thanks, for the help

    
asked by rose dewitt 30.11.2018 в 06:48
source

0 answers