Open
Description
In colab and locally, I am having trouble executing prob_dist.md
:
It might be related to this:
ranaroussi/yfinance#1333
In colab and locally, I am having trouble executing prob_dist.md
:
It might be related to this:
ranaroussi/yfinance#1333
Activity
mattiaslamotte commentedon Jan 10, 2025
I've had the same issue. My code was working fine last week, and it won't run this week as "Adj Close" is no longer accessible through the yf.download() method. Really annoying! Using unadjusted closing prices is completely useless - I will no longer use yfinance package in the future...
Heinrich-XIAO commentedon Jan 10, 2025
Same.
rowanc1 commentedon Jan 14, 2025
Should be fixed with #564!
mattiaslamotte commentedon Jan 14, 2025
It is not fixed. Any changes to an API such as yfinance should be back compatible to ensure that people's code is not broken subsequent to changes. If you're planning on implementing breaking code, you need to have a user warning months in advance - otherwise users will just walk away and use a different API.
If you go on Google Colab, the code below used to work and doesn't work anymore.
!pip install yfinance
import yfinance as yf
data = yf.download(["AAPL","AMZN"], start="2020-01-01")
prices= data['Adj_Close'] #fails on this line
print(prices)
Historically, if you were going to download one data series with yfinance, it would be 'Adj_Close'. If 'Close' has become 'Adj_Close' in the YF database, it's a very serious issue for everyone using the API. When I go on the web site, both the 'Close' and 'Adj_Close' columns are still shown in manually downloaded data - this implies that both columns are still in the underlying yahoo finance data.
mmcky commentedon Jan 14, 2025
Thanks everyone for your comments - We definitely want to use
Adj Close
as it accounts for splits and dividends. Digging through theyfinance
api to see if it is accessible.https://stackoverflow.com/questions/76964889/yfinance-download-auto-adjust-true-what-does-it-actually-do
mmcky commentedon Jan 14, 2025
This code https://github.com/ranaroussi/yfinance/blob/0713d9386769b168926d3959efd8310b56a33096/yfinance/utils.py#L445-L462 suggests that the
Close
is theAdj Close
but I will confirm by posting an issue on theyfinance
repo.mattiaslamotte commentedon Jan 14, 2025
I agree that it looks like it has been renamed, and that Close is actually now "Adj_Close". This is a really surprising change given that it breaks everyone's code. It would be interesting to understand the logical reasoning behind it given that the Yahoo Finance web site still shows both Close and Adj Close under the historical data tab.
This change also breaks your code if you built your own custom Adj_Close using the old nominal Close (for example, an "after tax" custom series to measure the after tax performance of different dividend distributing stock portfolios). There are just so many reasons why this change is complete nonsense...
cfigy commentedon Jan 15, 2025
Using 0.2.51 I added auto_adjust=TorF as example below:
df = yf.download("AAPL", start="2024-01-01", end="2025-01-14", auto_adjust=False)
Should get you back to having "Adj Close"