arleigh418 / python-and-Taiwan-stock-market

Python 金融市場賺大錢聖經:寫出你的專屬指標
58 stars 19 forks source link

pyfolio 問題 #43

Open sam0724sam opened 1 year ago

sam0724sam commented 1 year ago

您好,在使用PYTHON 金融市場賺大錢聖經書的tech1_ma_strategy.py時,遇到AttributeError: 'Series' object has no attribute 'iteritems',根據報錯更改(file:///C:/ProgramData/Anaconda3/lib/site-packages/pyfolio/plotting.py)及(file:///C:/ProgramData/Anaconda3/lib/site-packages/pyfolio/tears.py)中的iteritems為items後,仍舊遇到相同報錯,因此想請問是否有遇過此問題及解決方法為何? 感謝~

arleigh418 commented 1 year ago

您好, 根據 https://stackoverflow.com/questions/76200452/error-while-iterating-over-dataframe-columns-entries-attributeerror-series 新版的pandas有相當巨大的變更,建議您嘗試降版,使用例如1.5.0或1.8.0的pandas版本再嘗試看看!