In [1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
In [5]:
data = pd.read_csv('ex2data2.txt', header=None, names=['microship1', 'microship2', 'y'])
data.head()
Out[5]:
In [7]:
def visualize(x, y, color):
fig = plt.figure()
ax = plt.axes()
ax.scatter(x, y, c=color)
plt.xlabel('microship1')
plt.ylabel('microship2')
plt.show()
visualize(data.microship1, data.microship2, data.y)