Created
April 12, 2023 15:20
-
-
Save srang992/134fa57009acf257d6e6de5068f2ca48 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
# removing the '%' sign from the cocoa_percent column | |
choco_data['cocoa_percent'] = choco_data['cocoa_percent'].str.strip('%') | |
# converting the datatype | |
choco_data['cocoa_percent'] = choco_data['cocoa_percent'].astype('float') | |
# showing the first 5 rows | |
choco_data['cocoa_percent'].head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment