mardi 22 décembre 2020

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). IF Statements [duplicate]

import requests
url ="https://financialmodelingprep.com/api/v3/profile/AAPL?apikey=demo"
data = requests.get(url).json()
data_pd = pd.DataFrame(data)

if data_pd["price"] >= data_pd["dcf"]:

I get an error on the very last line. I don't understand why this is throwing an error because I am just comparing the header value and there is only one possible value for "price" and "dcf".

Aucun commentaire:

Enregistrer un commentaire