Skip to content

Instantly share code, notes, and snippets.

@xiaowei1234
Created July 27, 2019 00:57
Show Gist options
  • Save xiaowei1234/4d86d64c47c79145a66776a0ea1b9898 to your computer and use it in GitHub Desktop.
Save xiaowei1234/4d86d64c47c79145a66776a0ea1b9898 to your computer and use it in GitHub Desktop.
create binary column on null values
wrap1 = DataFrameMapper([
('col_with_nulls', ExpressionTransformer("0 if pandas.isnull(X[0]) else 1")
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment