Answers for "change a data type of a column in pandas"

8

change dataframe column type

>>> df.astype({'col1': 'int32'}).dtypes
col1    int32
col2    int64
dtype: object
Posted by: Guest on July-09-2020
2

set type of column pandas

df.astype(int)
Posted by: Guest on November-30-2020

Code answers related to "change a data type of a column in pandas"

Python Answers by Framework

Browse Popular Code Answers by Language