In Logistic Regression section of the code
Prepare data code cell
for the following line the below mentioned error occurs
plt.scatter(X_class0[:,0], X_class0[:,1],color='red')
ValueError Traceback (most recent call last)
in ()
27 Y_class1 = np.ones((X_class1.shape[0]),dtype=np.int)
28
---> 29 plt.scatter(X_class0[:,0], X_class0[:,1],color='red')
30 plt.scatter(X_class1[:,0], X_class1[:,1],color='blue')
31 plt.xlabel('sepal length')
~/anaconda3/envs/mlai/lib/python3.6/site-packages/matplotlib/pyplot.py in scatter(x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, hold, data, **kwargs)
3468 vmin=vmin, vmax=vmax, alpha=alpha,
3469 linewidths=linewidths, verts=verts,
-> 3470 edgecolors=edgecolors, data=data, **kwargs)
3471 finally:
3472 ax._hold = washold
~/anaconda3/envs/mlai/lib/python3.6/site-packages/matplotlib/init.py in inner(ax, *args, **kwargs)
1853 "the Matplotlib list!)" % (label_namer, func.name),
1854 RuntimeWarning, stacklevel=2)
-> 1855 return func(ax, *args, **kwargs)
1856
1857 inner.doc = _add_data_doc(inner.doc,
~/anaconda3/envs/mlai/lib/python3.6/site-packages/matplotlib/axes/_axes.py in scatter(self, x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, **kwargs)
4285 x, y, s, c, colors, edgecolors, linewidths =
4286 cbook.delete_masked_points(
-> 4287 x, y, s, c, colors, edgecolors, linewidths)
4288
4289 scales = s # Renamed for readability below.
~/anaconda3/envs/mlai/lib/python3.6/site-packages/matplotlib/cbook/init.py in delete_masked_points(*args)
1655 if isinstance(x, np.ma.MaskedArray):
1656 if x.ndim > 1:
-> 1657 raise ValueError("Masked arrays must be 1-D")
1658 else:
1659 x = np.asarray(x)
ValueError: Masked arrays must be 1-D