1

我想从 yfinance 获得市盈率。

import yfinance as yf

symbol = yf.Ticker('msft').info
print(symbol['pe_ratio']) 
4

1 回答 1

2

两个可用的yfinancetrailingPEforwardPE。要获得它们:

import yfinance as yf

symbol = yf.Ticker("msft").info
symbol["trailingPE"]
symbol["forwardPE"]
于 2020-11-14T19:20:23.503 回答