Created
September 16, 2020 00:12
-
-
Save deanjamesss/e021f170a2b1b26f874b75ef6a5aa847 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Set a default category for missing genders. | |
| df['gender'].cat.add_categories(new_categories=['U'], inplace=True) | |
| df.fillna(value={'gender': 'U'}, inplace=True) | |
| print(df.info()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment