最新回答 / 慕仰8124734
注意loc函數(shù)的端點是閉區(qū)間
這里直接二分類有點草率啦,因為本身鳶尾花數(shù)據(jù)集是存在有三個種類的花的數(shù)據(jù)分類的
2021-06-27
最新回答 / weixin_慕尼黑7100639
<...code...>import matplotlib.pyplot as pltimport numpy as npy = df.loc[0:100, 4].values #loc/iloc得統(tǒng)一y = np.where(y == 'Iris-setosa', -1, 1)#抽出第0列和第2列X = df.loc[0:100, [0, 2]].values # loc/iloc得統(tǒng)一plt.scatter(X[:50, 0], X[:5...
IndexError: boolean index did not match indexed array along dimension 0; dimension is 100 but corresponding boolean dimension is 101
最新回答 / 北國之春
數(shù)據(jù)文件(iris.data.csv):https://graph-bed-1256708472.cos.ap-chengdu.myqcloud.com/pythondata%2Firis.data.csv
2021-02-04
最贊回答 / TECHNOLOGY_net
兩行code解決問題,只顯示error級別的通知<...code...>
數(shù)據(jù)文件(iris.data.csv):https://graph-bed-1256708472.cos.ap-chengdu.myqcloud.com/pythondata%2Firis.data.csv
2020-07-19