Skip to content
Advertisement

pandas not converting an object dtype to float64 even after error free execution of df.astype(‘float64’)

I have tried to convert an object dtype column to float64 using .astype('float64') It ran without raising any error, but when I check the dtype using .dtype or .dtypes it is showing that converted column again as object.

JavaScript
JavaScript

real_estate.dtypes

JavaScript

Why is it not converting and why isn’t it giving any error?

also, real_estate['Age at time of purchase'].dtype this is giving me something that I haven’t expected. dtype('O') What does dtype('O') mean?

Advertisement

Answer

you can try like this

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement