IndexError
ile "F:/python項目開發/神經網絡/Neural+Networks.py", line 127, in plot_decision_regions
??? plt.scatter(x=x[y==cl, 0], y = x[y==cl,1],alpha=0.8,c = cmap(idx),
IndexError: index 100 is out of bounds for axis 0 with size 100
求解答
ile "F:/python項目開發/神經網絡/Neural+Networks.py", line 127, in plot_decision_regions
??? plt.scatter(x=x[y==cl, 0], y = x[y==cl,1],alpha=0.8,c = cmap(idx),
IndexError: index 100 is out of bounds for axis 0 with size 100
求解答
2017-10-28
舉報
2019-05-22
y=df.loc和iloc不太一樣
2017-11-02
y = df.loc[:100, 4].values 改為?y = df.loc[:99, 4].values
或者
x = df.iloc[:100, [0, 2]].values 改為?x = df.iloc[:101, [0, 2]].values
不知道為啥,反正能運行了就,不然說數組越界