Last active 1730172870

yfinance-9.py Raw
1import yfinance as yf
2
3# Ticker to Sector and Industry
4msft = yf.Ticker('MSFT')
5tech = yf.Sector(msft.info.get('sectorKey'))
6software = yf.Industry(msft.info.get('industryKey'))
7
8# Sector and Industry to Ticker
9tech_ticker = tech.ticker
10tech_ticker.info
11software_ticker = software.ticker
12software_ticker.history()