Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.

Latest commit

 

History

History
55 lines (34 loc) · 1.72 KB

File metadata and controls

55 lines (34 loc) · 1.72 KB

pandas stock notebook

MADE WITH JYPYTER MADE WITH JYPYTER CC BY-NC-SA 4.0

使用 Pandas 和 yfinance 的查詢香港股票的 Jupyter Notebook 範例

👇 親自試試看 👨‍💻

Open In Colab Binder


安裝 Python Packages

pip install -r requirements.txt

用法

從 stocks.py 載入 stock_profile 類別

from stocks import stock_profile

stocks = stock_profile()

從 JSON 文件讀入股票組合清單及股票名稱索引

stocks.loadJsonProfile('./stocks.json')

從 Yahoo Finance 下載股票組合數據

from datetime import date

tickers = ['0001.hk', '0941.hk','1810.hk']
start_date = date(2021, 9, 15)

stocks.cacheFromYfinance(tickers, start_date)

License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0