Replies: 1 comment
-
The astype() method will only be able to convert the data type of a column if all of the values in the column can be safely converted to the desired data type. If any values in the column cannot be converted, the astype() method will return an error. For Example: In string to Int Conversion I hope you get my point. |
Beta Was this translation helpful? Give feedback.
-
The favourite_Dish column data type is "object"
I ran this code line df['favourite_Dish'].astype('str') but it does not change the datatype object to string
code running without error.
if run same on df['Height'].astype('int') it work properly
Beta Was this translation helpful? Give feedback.
All reactions