Answers for "change type for coluumn pandas"

8

change dataframe column type

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

change a coolumn datatype in pandas

df = df.astype({"Column 1": float, "Column 2": int})
Posted by: Guest on February-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language