You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ratio = (df["Adj Close"] / df["Close"]).to_numpy()
Possible Fix:
# Convert columns to numeric, coercing errors to NaN if there are non-numeric values
df["Adj Close"] = pd.to_numeric(df["Adj Close"], errors='coerce')
df["Close"] = pd.to_numeric(df["Close"], errors='coerce')
# Perform the division and convert the result to a NumPy array
ratio = (df["Adj Close"] / df["Close"]).to_numpy()
# Optionally, you could also drop any rows where the conversion resulted in NaN values:
# df.dropna(subset=["Adj Close", "Close"], inplace=True)
The text was updated successfully, but these errors were encountered:
First off, awesome library! I am getting a lot of use out of it.
I got the following error when using this library:
Error:
auto_adjust failed with unsupported operand type(s) for /: 'str' and 'float'
Call to reproduce:
I believe the error is coming from here:
yfinance/yfinance/utils.py
Line 453 in 3fe87cb
Possible Fix:
The text was updated successfully, but these errors were encountered: