这是我编写的:
def statement(ticker,statement):
if statement =='IS':
temp='income-statement'
elif statement =='BS':
temp='balance-sheet-statement'
else:
temp='cash-flow-statement'
df = tickers.temp(frequency='q')
return df
tickers=['AAPL','GOOG','TSLA']
我希望函数中的temp替换为df = tickers.temp(frequency ='q'),并在用股票代码替换股票代码时最终给我正确的财务报表。如果有人有类似的合适代码,请在下面将其发布