Skip to content

Instantly share code, notes, and snippets.

@FranciscusRenatus
Last active June 20, 2017 16:25
Show Gist options
  • Save FranciscusRenatus/6ddb3c53d8bb552329f8659c411b5897 to your computer and use it in GitHub Desktop.
Save FranciscusRenatus/6ddb3c53d8bb552329f8659c411b5897 to your computer and use it in GitHub Desktop.
code-snippet
#Taking care of missing data using Python
from sklearn.preprocessing import Imputer
imputer = Imputer(missing_values = 'NaN', strategy = 'mean', axis=0)
imputer = imputer.fit(X[:,1:3])
X[:, 1:3] = imputer.transform(X[:, 1:3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment