Comments (1)
您好,
謝謝您提出的問題。
推測應該是yfinance對於處理時區的方式有所變更,導致存擋時pandas無法正確處理。
簡單的處置方式有二,二選一即可解決您提出的問題,看您覺得哪一個好:
-
直接將時區資料轉為string之後再存
df = stock.history(start="2017-01-01", end="2021-02-02")
df.index = df.index.astype(str)
-
將檔案存成csv
df.to_csv("final.csv")
from python-and-taiwan-stock-market.
Related Issues (20)
- 遇到 OSError? HOT 8
- 排程的權限問題及執行檔問題 HOT 7
- Google 不支援低安全模式 HOT 1
- 爬蟲遇到的問題 HOT 3
- stock_list.py執行錯誤 HOT 8
- 請問關於自動寄信 HOT 3
- about pandas rolling HOT 2
- 關於yahoo_new小程式 HOT 2
- 關於matplotlib HOT 7
- backtrader問題 HOT 2
- 關於 mpl_finance失效的問題 HOT 2
- 有關更多操作自動化的問題 HOT 2
- 關於PYTHON 金融市場賺大錢聖經書中 HOT 7
- 關於AES_Encryption等第三章問題 HOT 50
- 第1-4虛擬環境 HOT 7
- 第二章27頁 HOT 11
- pyfolio 問題 HOT 1
- 第三章'Crypto'的問題 HOT 1
- 第二章 2-21 輸出的中文變成亂碼 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-and-taiwan-stock-market.