Created
February 3, 2015 13:42
-
-
Save DownGoat/e3f3fb663c064e1d57c6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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