Answers for "pandas dataframe force dtype for all columns"

8

change dataframe column type

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

astype float across columns pandas

cols = df.columns[df.dtypes.eq('object')]
Posted by: Guest on November-24-2020

Code answers related to "pandas dataframe force dtype for all columns"

Python Answers by Framework

Browse Popular Code Answers by Language