代码运行错误,我是按照老师的代码写的啊
import matplotlib.pyplot as plt
import numpy as np
y = df.loc[0:100,2].values
y = np.where(y==1, 2,-2)
X=df.iloc[0:17, [0,2]].values
plt.scatter(X[:9,0],X[:9,1],color='red',marker='o',label='setosa')
plt.scatter(X[9:17, 0], X[9:17,1], color='blue', marker='+', label='rating')
plt.xlabel("Length of Petal")
plt.ylabel("Length of Scape")
plt.legend(loc='upper left')
plt.show()
报的错误是: ValueError: First argument must be a sequence
请问各位大神,这个问题怎么解决啊,昨天花了大半天也没搞清楚这个错误是什么。谢谢了先!!!