Skip to content

Instantly share code, notes, and snippets.

@grohith327
Created May 28, 2018 09:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grohith327/8ede2dd0487009b3de9be9ffb3b5f4e7 to your computer and use it in GitHub Desktop.
Save grohith327/8ede2dd0487009b3de9be9ffb3b5f4e7 to your computer and use it in GitHub Desktop.
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