請問Part1_data_collector於跨年後產生錯誤
今日運行程式跳出錯誤訊息如下:(以下錯誤代碼部分)
生成 2021 年每日成交資訊 : (0, 0)
合併歷年每日成交
載入 2013 年每日成交資訊
載入 2014 年每日成交資訊
載入 2015 年每日成交資訊
載入 2016 年每日成交資訊
載入 2017 年每日成交資訊
載入 2018 年每日成交資訊
載入 2019 年每日成交資訊
載入 2020 年每日成交資訊
載入 2021 年每日成交資訊
history daily file does not exist!
合併歷年月報表 / 季報表 / 指數資料
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
2894 try:
-> 2895 return self._engine.get_loc(casted_key)
2896 except KeyError as err:
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: '日期'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
回答列表
-
2021/01/01 下午 05:12larry wong贊同數:0不贊同數:0留言數:0
我按照格式弄了一個1月1日就能跑過去,但是實際上1月1日不應該有資料,應該如何正確處理?
-
2021/01/03 上午 00:40Jeffrey贊同數:1不贊同數:0留言數:0
一般程式碼可以去定義假期(設定以 NULL 值取代)或是去複製最近一筆的交易