Created
June 2, 2019 05:02
-
-
Save guerbai/815932bb1b4b3f5079518a9fe5f72f66 to your computer and use it in GitHub Desktop.
去掉有nan的列 #Pandas
This file contains 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
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