Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas change column dtype

# Individual  
df['a'] = df_test['a'].astype('float64')
df['b'] = df_test['b'].astype('int64')
# Batch
dtype_d = {"a": "float64", "b": "int64"} # dtype dictio
df = df.astype(dtype_d)
Source by pandas.pydata.org #
 
PREVIOUS NEXT
Tagged: #pandas #change #column #dtype
ADD COMMENT
Topic
Name
8+3 =