Skip to content
All library documents

How yfinance Adjusts Prices for Stock Splits and Dividends

Article Quant Q&A · Author: algotrader487

Summary

The discussion explains that yfinance can return prices adjusted for stock splits and dividends. The accepted answer says that setting auto_adjust to True adjusts the downloaded data and, in the cited version, means the adjusted close column may be omitted because it matches the close column. A second answer says Yahoo’s API adjusts prices for splits, while differences between close and adjusted close reflect dividends.

The original question arose from a suspected split-data error in one ticker’s daily history. The replies suggest that the observed lack of a split discontinuity is consistent with already-adjusted prices, though one answer allows that the particular observation could be a data error. The statements are tied to the library version and API behavior mentioned in the thread; users should check the adjustment setting and inspect the returned columns before interpreting historical prices. The discussion does not establish that every download configuration or data point is error-free.

Key ideas

  • The auto_adjust setting determines whether downloaded prices are adjusted for splits and dividends.
  • In the cited yfinance version, adjusted close may be absent when it equals close.
  • A split-adjusted series may not show a raw price discontinuity on the split date.
  • Check adjustment settings and returned columns, since the thread does not rule out data errors.

Tags

Full text
# Does yfinance always ignore stock splits?


# Does yfinance always ignore stock splits?












I'm using the yfinance library to download stock prices. For a few samples, I noticed that stock splits are not taken into account at all. For example the ticker 'ANET' had a 4:1 stock split at December 4th 2024. If you call df=yf.download('ANET',interval='1d',period='1y'), you can see that the close and adj. close is equal around that date and also there is no discontinuity between Dec 4th and 5th of a factor 4 in the close price. Could anyone confirm that yfinance doesn't consider stock splits in general or is this just an exception which arises due to data errors of yahoo?

## Answer by user80016 (score 1, accepted)

https://quant.stackexchange.com/a/81613

If the parameter `auto_adjust` is set to `True` in `yf.download` it will adjust your data to splits and dividends, in yfinance 0.2.51 you will not even get the `Adj Close` column, since `Adj Close` will be equal to `Close`.

finance considers stock splits, you are probably seeing a data error.

## Answer by Idou (score 0)

https://quant.stackexchange.com/a/84015

Yahoo's official api always adjusts price for stock split, so you actually cannot get price data before this adjustment with yfinance. The difference between close and adj close only comes from dividends.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.