【发布时间】:2020-03-09 21:37:51
【问题描述】:
我正在做一个数据科学项目,我试图利用之前的警察站来预测未来的警察站。我正在尝试制作时间与地理空间经度的自相关图,但是当我尝试制作该图时,我不断收到错误消息。这使我无法找到正确的滞后来制作 ARIMA 模型。
from pandas import datetime
from pandas import to_datetime
from matplotlib import pyplot
from pandas.plotting import autocorrelation_plot
dataSet = read_excel('SeniorProject.xlsx', header=0,
encoding = "ISO-8859-1")
mini = dataSet[['TIME_PHONEPICKUP','GEO_LON']]
#print(mini)
#mini.plot(x='TIME_PHONEPICKUP',y='GEO_LON', color='blue')
autocorrelation_plot(mini)
pyplot.show()
错误
TypeError: unsupported operand type(s) for +: 'Timestamp' and 'Timestamp'
UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
ax = plt.gca(xlim=(1, n), ylim=(-1.0, 1.0))
During handling of the above exception, another exception occurred:
KeyError: '__name__'
一些样本数据
TIME_PHONEPICKUP GEO_LON
0 2019-09-09 03:57:08 -105.025060
1 2019-09-09 03:55:39 -104.990248
2 2019-09-09 03:52:32 -104.925776
3 2019-09-09 03:49:44 -105.032151
4 2019-09-09 03:45:23 -105.029842
TIME_PHONEPICKUP 的数据类型为:datetime64[ns],GEO_LON 的数据类型为:float64。我是否错误地设置了自相关图?
【问题讨论】:
标签: python pandas matplotlib data-science