Skip to content

Instantly share code, notes, and snippets.

@grohith327
Created June 13, 2018 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grohith327/722711e97143109bd3845e1eb5d5fa9b to your computer and use it in GitHub Desktop.
Save grohith327/722711e97143109bd3845e1eb5d5fa9b to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
points_1 = df[0:50].values.tolist()
points_2 = df[50:100].values.tolist()
points_3 = df[100:].values.tolist()
points_1 = np.array(points_1)
points_2 = np.array(points_2)
points_3 = np.array(points_3)
## Plot the data points to visualize
plt.figure(figsize=(16,9))
plt.scatter(points_1[:,0],points_1[:,1],color='red',label='Setosa')
plt.scatter(points_2[:,0],points_2[:,1],color='black',label='Versicolor')
plt.scatter(points_3[:,0],points_3[:,1],color='green',label='Virginica')
plt.legend()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment