Created
May 28, 2018 09:53
-
-
Save grohith327/8ede2dd0487009b3de9be9ffb3b5f4e7 to your computer and use it in GitHub Desktop.
This file contains 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
import pandas as pd | |
df = pd.read_csv('/Users/rohith/Documents/Datasets/Iris_dataset/iris.csv') ## Load data | |
df = df.drop(['Id'],axis=1) | |
rows = list(range(100,150)) | |
df = df.drop(df.index[rows]) ## Drop the rows with target values Iris-virginica | |
Y = [] | |
target = df['Species'] | |
for val in target: | |
if(val == 'Iris-setosa'): | |
Y.append(0) | |
else: | |
Y.append(1) | |
df = df.drop(['Species'],axis=1) | |
X = df.values.tolist() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment