Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas change column type

# select columns that need to be converted
cols = df.select_dtypes(include=['float64']).columns.to_list()
df = df.astype({col:int for col in cols})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #change #column #type
ADD COMMENT
Topic
Name
7+3 =