Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas change 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 www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #pandas #change #dtype
ADD COMMENT
Topic
Name
4+7 =