Skip to content

Instantly share code, notes, and snippets.

@DownGoat
Created February 3, 2015 13:42
Show Gist options
  • Save DownGoat/e3f3fb663c064e1d57c6 to your computer and use it in GitHub Desktop.
Save DownGoat/e3f3fb663c064e1d57c6 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
dataset = open("assignment1_train.txt", "rb")
x = []
y = []
color=[]
for line in dataset:
line = line.strip()
line = line.split(" ")
print(line)
x.append(line[0])
y.append(line[1])
if line[2] == "1":
color.append("red")
else:
color.append("green")
plt.scatter(x, y, s=25, c=color, alpha=1)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment