Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from numpy import vstack, array, nan
- from sklearn.preprocessing import Imputer
- #missing value calculation, return value is the data after calculating the missing value
- # The parameter missing_value is a representation of the missing value. The default is NaN.
- #Parameters is a missing value filling method, the default is mean (mean)
- Imputer().fit_transform(vstack((array([nan, nan, nan, nan]),iris.data)))
Add Comment
Please, Sign In to add comment