Skip to content

Instantly share code, notes, and snippets.

@guerbai
Created June 2, 2019 05:02
Show Gist options
  • Save guerbai/815932bb1b4b3f5079518a9fe5f72f66 to your computer and use it in GitHub Desktop.
Save guerbai/815932bb1b4b3f5079518a9fe5f72f66 to your computer and use it in GitHub Desktop.
去掉有nan的列 #Pandas
cols_with_missing = [col for col in X_train.columns
if df[col].isnull().any()]
reduced_df = df.drop(cols_with_missing, axis=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment