'c' argument has 1 elements, which is not acceptable for use with 'x' with size 400, 'y' with size 4

吴恩达《神经网络与深度学习》第一课第三周作业,程序报错,成功解决:

‘c’ argument has 1 elements, which is not acceptable for use with ‘x’ with size 400, ‘y’ with size 400.

自己看了好几次,已有博客给了正解,但是没说清楚,还是没解决问题。

其实是修改planar_utils.py 里的 plt.scatter() 函数,把 y 换成 np.squeeze(y),自己在外面写也加上np.squeeze()

'c' argument has 1 elements, which is not acceptable for use with 'x' with size 400, 'y' with size 4_第1张图片

顺便说一下:‘c’ 是代表颜色, ‘s’ 是代表圆圈大小, 可以 ?plt.scatter 研究下
祝你成功~~

你可能感兴趣的:(DEBUG)