股票分析1.下载数据

使用 WSL

安装 python 扩展

安装依赖

Copy
sudo apt update
sudo apt upgrade

下载苹果公司股票数据

Copy
pip3 install yfinance

Copy
import yfinance as yf
Apple =yf.download("AAPL",start="2010-01-01",end="2011-01-01")

批量下载数据

Copy
ticker=["SPY","AAPL","KO"]
stocks =yf.download(ticker,start="2010-01-01",end="2011-01-01")

保存到本地

Copy
stocks.to_csv('stocksYT.csv')