dimension is 100 but corresponding boolean dimension is 101
IndexError Traceback (most recent call last)
<ipython-input-45-a65b21b8df17> in <module>
----> 1 plot_decision_regions(X,y,ppn,resolution=0.02)
2 plt.xlabel('花径长度')
3 plt.ylabel('花瓣长度')
4 plt.legend(loc='upper left')
5 plt.show()
<ipython-input-44-85f310d48d44> in plot_decision_regions(X, y, classifier, resolution)
30
31 for idx,cl in enumerate(np.unique(y)):
---> 32 plt.scatter(x=X[y==cl,0],y=X[y==cl,1],alpha=0.8,c=cmap(idx),marker=marker[idx],label=cl)
IndexError: boolean index did not match indexed array along dimension 0; dimension is 100 but corresponding boolean dimension is 101