2017-04-18 10 views
1

:私は印刷する場合Fbprophetクイックスタート例 - KeyError例外: 'DS' のモデルに合うようにしようと、問題持つクイックスタート例&後

Traceback (most recent call last): 
File "/home/cartier/miniconda2/envs/prophet/lib/python3.6/site-packages/pandas/indexes/base.py", line 2134, in get_loc 
return self._engine.get_loc(key) 
File "pandas/index.pyx", line 132, in pandas.index.IndexEngine.get_loc (pandas/index.c:4433) 
File "pandas/index.pyx", line 154, in pandas.index.IndexEngine.get_loc (pandas/index.c:4279) 
File "pandas/src/hashtable_class_helper.pxi", line 732, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:13742) 
File "pandas/src/hashtable_class_helper.pxi", line 740, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:13696) 
KeyError: 'ds' 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
File "prophexample.py", line 10, in <module> 
m.fit(df); 
File "/home/cartier/miniconda2/envs/prophet/lib/python3.6/site-packages/fbprophet/forecaster.py", line 484, in fit 
self.history_dates = pd.to_datetime(df['ds']).sort_values() 
File "/home/cartier/miniconda2/envs/prophet/lib/python3.6/site-packages/pandas/core/frame.py", line 2059, in __getitem__ 
return self._getitem_column(key) 
File "/home/cartier/miniconda2/envs/prophet/lib/python3.6/site-packages/pandas/core/frame.py", line 2066, in _getitem_column 
return self._get_item_cache(key) 
File "/home/cartier/miniconda2/envs/prophet/lib/python3.6/site-packages/pandas/core/generic.py", line 1386, in _get_item_cache 
values = self._data.get(item) 
File "/home/cartier/miniconda2/envs/prophet/lib/python3.6/site-packages/pandas/core/internals.py", line 3543, in get 
loc = self.items.get_loc(item) 
File "/home/cartier/miniconda2/envs/prophet/lib/python3.6/site-packages/pandas/indexes/base.py", line 2136, in get_loc 
return self._engine.get_loc(self._maybe_cast_indexer(key)) 
File "pandas/index.pyx", line 132, in pandas.index.IndexEngine.get_loc (pandas/index.c:4433) 
File "pandas/index.pyx", line 154, in pandas.index.IndexEngine.get_loc (pandas/index.c:4279) 
File "pandas/src/hashtable_class_helper.pxi", line 732, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:13742) 
File "pandas/src/hashtable_class_helper.pxi", line 740, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:13696) 
KeyError: 'ds' 

m.fit(df); 

ターミナルショー頭、尾または全体のdfそれはいいです:

  ds   y 
0 2007-12-10 9.590761 
1 2007-12-11 8.519590 
2 2007-12-12 8.183677 
3 2007-12-13 8.072467 
4 2007-12-14 7.893572 

これは私がusiではないためですか?ノートブックを使うか、何か他のものが欠けていますか?ありがとう

答えて

0

すべての日付が見つかりませんでした。日付は7/13/08から7/31/08にスキップされます。いったん私はいくつかのランダムなyの値で欠けている日付を入れて、それは大丈夫だった。多分、不足している日付を無視する設定/コマンドがあります... enter image description here

関連する問題