Skip to content

Instantly share code, notes, and snippets.

@95Rajitha
Created June 27, 2020 17:17
Show Gist options
  • Save 95Rajitha/708c8b8ad6b013bee11386850c320c30 to your computer and use it in GitHub Desktop.
Save 95Rajitha/708c8b8ad6b013bee11386850c320c30 to your computer and use it in GitHub Desktop.
this is all about the data preprocessing
Display the source blob
Display the rendered blob
Raw
import numpy as np
import matplotlib.pyplot as pit
import pandas as pd
dataSet = pd.read_csv('SampleData.csv')
x = dataSet.iloc[:,:-1].values
y = dataSet.iloc[:,-1].values
print(x)
print(y)
imputer = SimpleImputer(missing_values=np.nan,strategy='mean')
imputer.fit(x[:,1:3])
x[:,1:3]=imputer.transform(x[:,1:3])
from sklearn.impute import SimpleImputer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment