Created
November 9, 2020 03:31
-
-
Save merishnaSuwal/2cc5dee6d544b326b9708d772232baa1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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