dataset=pd.read_csv("rainfall in india 1901-2015.csv")
#parse strings to datetime type
dataset['YEAR']=pd.to_datetime(dataset['YEAR'],infer_datetime_format=True)
indexedDataset = dataset.set_index(['YEAR'])
plt.xlabel("Date")
plt.ylabel("Number of air passengers")
plt.plot(indexedDataset)
TypeError Traceback (most recent call last) in () 1 plt.xlabel("Date") 2 plt.ylabel("Number of air passengers") ----> 3 plt.plot(indexedDataset)
TypeError: unhashable type: 'numpy.ndarray'
matplotlib.pyplot
不能像您给出的那样绘制原始数据帧。您需要为它指定一个X轴数组和一个Y轴数组,或者使用pandas plotting工具相关问题 更多 >
编程相关推荐