Skip to content

Instantly share code, notes, and snippets.

@mzaradzki
Last active July 3, 2017 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzaradzki/e530f682415d1032e5c63a620516a0d3 to your computer and use it in GitHub Desktop.
Save mzaradzki/e530f682415d1032e5c63a620516a0d3 to your computer and use it in GitHub Desktop.
Handling of Null values for categorical and boolean columns in Pandas dataframes
for col, tp in nullcols:
if (tp == str):
dfX.loc[dfX[col].isnull(), col] = 'MISSING'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment