【问题标题】:Is there a way to get the PE ratio from Python's yfinance module?有没有办法从 Python 的 yfinance 模块中获取 PE 比率?
【发布时间】:2021-02-26 09:44:24
【问题描述】:

我想从 yfinance 获得市盈率。

import yfinance as yf

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

【问题讨论】:

    标签: python yfinance


    【解决方案1】:

    yfinance 中的两个可用是 trailingPEforwardPE。要获得它们:

    import yfinance as yf
    
    symbol = yf.Ticker("msft").info
    symbol["trailingPE"]
    symbol["forwardPE"]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-27
      • 2012-08-13
      • 2020-05-01
      • 1970-01-01
      • 2014-03-02
      • 2016-12-16
      • 1970-01-01
      • 2011-07-14
      相关资源
      最近更新 更多