Skip to content

Instantly share code, notes, and snippets.

@ArthurEzenwanne
Last active August 19, 2019 14:49
Show Gist options
  • Save ArthurEzenwanne/97795e906ed55364aa7713c9d168d25e to your computer and use it in GitHub Desktop.
Save ArthurEzenwanne/97795e906ed55364aa7713c9d168d25e to your computer and use it in GitHub Desktop.
# Get the names of columns with missing values
cols_with_missing = [col for col in X_train.columns if X_train[col].isnull().any()]
# Drop columns in training and validation data containing missing values
reduced_X_train = X_train.drop(cols_with_missing, axis=1)
reduced_X_valid = X_valid.drop(cols_with_missing, axis=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment