E1: nameError name 'array' is not defined python
from array import array
I tried importing array (from array import array), but it then fails saying that
TypeError: array() argument 1 must be a unicode character, not list
E2: TypeError: array() argument 1 must be a unicode character, not list
from numpy import array
code:
import matplotlib
from numpy import array
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
ax.scatter(datingDataMat[:,1],datingDataMat[:,2], 15.0*array(datingLabels), 15.0*array(datingLabels))
plt.show()

606

被折叠的 条评论
为什么被折叠?



