我正在尝试从 Yahoo Finance 下载基本数据,例如 PE 比率、PB 比率、EV/EBITDA 等。这是我迄今为止所做的:
#import required libraries
import pandas as pd
import numpy as np
import requests
import xlsxwriter
from scipy import stats
import math
import secrets
import yfinance as yf
import matplotlib.pyplot as plt
import datetime as dt
import statsmodels.api as sm
pip install requests_html
stocks = pd.read_csv('constituents.csv')
from yahoo_fin.stock_info import get_data
sm.get_stats_valuation("aapl")
我收到此错误:
AttributeError Traceback (most recent call last)
<ipython-input-17-7a641ee9069d> in <module>
----> 1 sm.get_stats_valuation("aapl")
AttributeError: module 'statsmodels.api' has no attribute 'get_stats_valuation'
我该怎么办?