Answers for "python change dtype"

4

change type of array python

arr=arr.astype('uint8')
Posted by: Guest on March-20-2020
8

change dataframe column type

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

Python Answers by Framework

Browse Popular Code Answers by Language