Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Selecting columns with data type as 'object'
columns = dataset.columns[dataset.dtypes.eq('object')]
# Convert to numeric values
dataset[columns] = dataset[columns].apply(pd.to_numeric, errors='coerce')
# Viewing the details
dataset.info()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment