Skip to content

Instantly share code, notes, and snippets.

@tcvieira
Forked from GeorgeSeif/dropping.py
Created January 21, 2019 14:09
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 tcvieira/887fc0ef8daeb0351985a7bc3ae14db8 to your computer and use it in GitHub Desktop.
Save tcvieira/887fc0ef8daeb0351985a7bc3ae14db8 to your computer and use it in GitHub Desktop.
# Computing correlation coefficients
x_cols = [col for col in data.columns if col not in ['output']]
for col in x_cols:
corr_coeffs = np.corrcoef(data[col].values, data.output.values)
# Get the number of missing values in each column / feature variable
data.isnull().sum()
# Drop a feature variable
data = data.drop('feature_name', 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment