Q. Why does Python change the datatype of a column as soon as it stores an empty value (NaN) even though it has all other values stored as integer?


Answer =

The reason behind it is that whenever any column of a dataframe has a NaN value in it, then its type is automatic changed to floating point because in python integer types cannot store nans values.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post