github
In [2]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
In [3]:
data = pd.read_csv("data.csv")
data.head(2)
Out[3]:
In [8]:
x = data.iloc[:,[0,1,2]]
y = data.iloc[:,3]
x
Out[8]:
In [10]:
x.iloc[:,2].fillna(np.mean(x.iloc[:,2]),inplace = True)
x.iloc[:,1].fillna(np.mean(x.iloc[:,1]),inplace = True)
x
Out[10]:
In [84]:
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import OneHotEncoder
In [12]:
x = pd.get_dummies(x)
x
Out[12]:
In [ ]:
In [ ]:
Comments
Post a Comment