如果使用所有标量值,则在将API更改为字符串

问题描述 投票:0回答:1
API = os.getenv('API_KEY') IQ = requests.get('https://financialmodelingprep.com/api/v3/stock-screener?marketCapMoreThan=1&dividendMoreThan=0&limit=100000000&&apikey=API').json() Stocks = pd.DataFrame(IQ) Stocks.set_index("symbol", inplace = True)``` response: If using all scalar values, you must pass an index

您已经写了它,apikey等于字符串“ API”。而是使用此:
python python-requests
1个回答
1
投票
IQ = requests.get(f'https://financialmodelingprep.com/api/v3/stock-screener?marketCapMoreThan=1&dividendMoreThan=0&limit=100000000&&apikey={API}').json()


最新问题
© www.soinside.com 2019 - 2025. All rights reserved.