Created
January 27, 2018 05:48
-
-
Save JoseRFJuniorLLMs/ce46bdef2ac59ea38175916ff636cba2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Data Preprocessing | |
# Importing the libraries | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
# Importing the dataset | |
dataset = pd.read_csv('Data.csv') | |
X = dataset.iloc[:, :-1].values | |
y = dataset.iloc[:, 3].values | |
# Taking care of missing data | |
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]) | |
print(X) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment