简体   繁体   English

使用ARMA模型在Python中修复数据集和预测时间序列

[英]Fixing dataset and Forecasting timeseries in Python with ARMA model

I have a dataset collected here . 在这里收集一个数据集。 First I wanted to tidy this dataset since it shows all the data in one column (instead of 10) when I use the read_csv from pandas . 首先,我想整理一下此数据集,因为当我使用pandasread_csv时,它会将所有数据显示在一个列中(而不是10个)。 The output is [8784 rows x 1 columns] which is wrong (how can I fix this issue?) 输出为[8784 rows x 1 columns] ,这是错误的(如何解决此问题?)

Second, I'd like to examine a simple ARMA model on this data set just to forecast the values of AC column (just for myself to get familiar with this model and data analyzing) Could you please help me with some hints? 其次,我想在此数据集上研究一个简单的ARMA模型,只是为了预测AC色谱柱的值(仅供我自己熟悉此模型和数据分析),能否请您帮我一些提示? How/where to start? 如何/从哪里开始? what to do? 该怎么办?

More info regarding the dataset: Let's say first row of this dataset shows that (eg) on 01-01-2016 at time 00:00 when the outside_tem is 12 (less than x=20) and the humidity is 10 (less than 20) the value of AC is off. 有关数据集的更多信息:假设此数据集的第一行显示(例如)在01-01-2016的时间00:00时, outside_tem为12(小于x = 20), humidity为10(小于20) ) AC值关闭。 What will be the value of AC in similar/different conditions (humidity, out_temp, light, etc.) at 01-01-2017 at 12:00? 在01-01-2017 12:00在相似/不同条件下(湿度,高温,光照等)的AC值是多少?

use pd.read_fwf() method: 使用pd.read_fwf()方法:

In [253]: df = pd.read_fwf(r'D:\download\comfort.csv')

In [254]: df
Out[254]:
            date   time  humidity  Outside_Temperature  window  light  age  skintemp  SR  AC
0     01-01-2016  00:00        10                   12       0      1   40        45   0   0
1     01-01-2016  01:00        10                   11       0      1   40        32   0   0
2     01-01-2016  02:00        10                   15       0      1   32        40   0   0
3     01-01-2016  03:00        10                   11       0      1   15        37   0   0
4     01-01-2016  04:00        10                   11       0      1   40        33   0   0
5     01-01-2016  05:00        10                   13       0      1   15        37   0   0
6     01-01-2016  06:00        10                   11       0      1   32        42   0   0
7     01-01-2016  07:00        10                   16       0      1   15        41   0   0
8     01-01-2016  08:00        20                   25       1      2   15        36   1   0
9     01-01-2016  09:00        20                   10       1      2   32        37   1   0
...          ...    ...       ...                  ...     ...    ...  ...       ...  ..  ..
8774  31-12-2016  14:00        20                   12       1      2   15        33   0   0
8775  31-12-2016  15:00        20                    9       1      2   15        29   0   0
8776  31-12-2016  16:00        30                    8       1      3   40        38   0   1
8777  31-12-2016  17:00        30                    9       1      3   32        43   0   1
8778  31-12-2016  18:00        30                   12       1      3   40        30   0   1
8779  31-12-2016  19:00        30                    3       1      3   32        28   0   1
8780  31-12-2016  20:00        10                   11       0      1   40        41   0   0
8781  31-12-2016  21:00        10                   12       0      1   32        26   0   0
8782  31-12-2016  22:00        10                    6       0      1   40        30   0   0
8783  31-12-2016  23:00        10                    8       0      1   32        35   0   0

[8784 rows x 10 columns]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM