Answers for "pandas how convert a column with mixed data type into integer type"

3

column dataframe to int

df[[column_name]].astype(int)
Posted by: Guest on April-21-2021
15

how to convert data type of a column in pandas

# You can use "astype" method
# suppose you want to correct your "sales" column data type
df['sales'] = df['sales'].astype('float64')
Posted by: Guest on July-20-2021

Code answers related to "pandas how convert a column with mixed data type into integer type"

Python Answers by Framework

Browse Popular Code Answers by Language