Skip to content

Last days data missing #2925

Closed as not planned
Closed as not planned

Description

@plajos1

Describe bug

Downloadig with

yf.download(ticker, start = start, end = end)

everything is fine except the last day: only the volume appears in the last line.

Simple code that reproduces your problem

datar = yf.download(ticker, start = start, end = end)

Debug log with debug logging enabled

[100%**] 1 of 1 completed
DEBUG Disabling multithreading because DEBUG logging enabled
DEBUG Entering history()
DEBUG Entering history()
DEBUG MU: Yahoo GET parameters: {'period1': '2021-07-28 00:00:00-04:00', 'period2': '2026-07-27 00:00:00-04:00', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG MU: yfinance received OHLC data: 2021-07-28 13:30:00 -> 2026-07-24 13:30:00
DEBUG MU: OHLC after cleaning: 2021-07-28 09:30:00-04:00 -> 2026-07-24 09:30:00-04:00
DEBUG MU: OHLC after combining events: 2021-07-28 00:00:00-04:00 -> 2026-07-24 00:00:00-04:00
DEBUG MU: yfinance returning OHLC: 2021-07-28 00:00:00-04:00 -> 2026-07-24 00:00:00-04:00
DEBUG Exiting history()
DEBUG Exiting history()
DEBUG Exiting download()
DEBUG Entering download()
DEBUG Disabling multithreading because DEBUG logging enabled
DEBUG Entering history()
DEBUG Entering history()
DEBUG MU: Yahoo GET parameters: {'period1': '2021-07-28 00:00:00-04:00', 'period2': '2026-07-27 00:00:00-04:00', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG MU: yfinance received OHLC data: 2021-07-28 13:30:00 -> 2026-07-24 13:30:00
DEBUG MU: OHLC after cleaning: 2021-07-28 09:30:00-04:00 -> 2026-07-24 09:30:00-04:00
DEBUG MU: OHLC after combining events: 2021-07-28 00:00:00-04:00 -> 2026-07-24 00:00:00-04:00
DEBUG MU: yfinance returning OHLC: 2021-07-28 00:00:00-04:00 -> 2026-07-24 00:00:00-04:00
DEBUG Exiting history()
DEBUG Exiting history()
DEBUG Exiting download()

Bad data proof

Price Close High Low Open Volume
Ticker MU MU MU MU MU
Date
2026-07-20 865.460022 901.000000 858.900024 885.570007 37705200
2026-07-21 970.820007 982.880005 916.570007 925.349976 49369000
2026-07-22 959.479980 982.619995 936.059998 938.250000 31588600
2026-07-23 990.210022 1011.770020 964.400024 975.130005 40196300
2026-07-24 NaN NaN NaN NaN 40626435

yfinance version

1.5.2

Python version

3.12

Operating system

W8.11

Activity

  1. llninja1 commented on Jul 27, 2026

    @llninja1

    I see the same thing.

    import yfinance as y
    y.download ('AAPL', '2026-1-1')
    [100%**] 1 of 1 completed
    Price Close High Low Open Volume
    Ticker AAPL AAPL AAPL AAPL AAPL
    Date
    2026-01-02 270.507446 277.324767 268.501164 271.755128 37838100
    2026-01-05 266.764404 271.006523 265.646486 270.138141 45647200
    2026-01-06 261.873474 267.053852 261.633929 266.504884 52352100
    2026-01-07 259.847229 263.191023 259.328204 262.711932 48309800
    2026-01-08 258.559631 258.809168 255.225814 256.543358 50419300
    ... ... ... ... ... ...
    2026-07-20 326.589996 333.709991 323.679993 333.510010 53468000
    2026-07-21 327.739990 329.600006 322.220001 323.130005 41338900
    2026-07-22 325.890015 329.000000 323.339996 327.869995 38755900
    2026-07-23 321.660004 323.299988 319.350006 321.730011 40840800
    2026-07-24 NaN NaN NaN NaN 47460975

    [140 rows x 5 columns]

  2. Josejsi commented on Jul 27, 2026

    @Josejsi

    Confirming the same issue, reproduced independently on multiple unrelated symbols — so this isn't ticker-specific.

    yfinance version: 1.5.2 (also present on 1.2.0 before upgrading — upgrading did not fix it)
    curl_cffi version: 0.15.0
    Python 3.12, Windows

    Affected: ^GSPC, ^NYA, ^IXIC (indices), AAPL, MSFT, JPM, SPY — all show the same pattern as MU above: Volume present for 2026-07-24, all OHLC fields NaN.

    As of 2026-07-27 (3+ days later) the gap has not self-resolved on any of these symbols.

    Cross-checked the actual 2026-07-24 S&P 500 close against FRED and Investing.com — both have complete data for that session (7,411.98), so the underlying data exists; it seems to be specifically missing/malformed in Yahoo's chart API response consumed by yfinance.

                                 Open       Close    Volume
    

    Date
    2026-07-23 00:00:00-04:00 321.730011 321.660004 40840800
    2026-07-24 00:00:00-04:00 NaN NaN 47460975

  3. ValueRaider commented on Jul 27, 2026

    @ValueRaider
    Collaborator

    Where is the proof that Yahoo has data?

    We are not affiliated with Yahoo

  4. llninja1 commented on Jul 29, 2026

    @llninja1

    Here is an interesting twist. Asking for one ticker only has NaNs on the Jul 28, but the line for the 24th is just missing (no NaNs, no line at all). Using yf.download() for multiple tickers is shows NaNs on some tickers for both the Jul 24 and 28th.

    yf.download('SPY XLC XLP XLY', '2026-7-1').xs("Close", axis=1, level=0)
    [100%] 4 of 4 completed
    Ticker SPY XLC XLP XLY
    Date
    2026-07-01 745.760010 109.739998 83.300003 118.089996
    2026-07-02 744.780029 109.599998 84.989998 117.120003
    2026-07-06 751.280029 110.209999 84.099998 118.010002
    2026-07-07 747.710022 111.019997 84.860001 117.389999
    2026-07-08 745.400024 109.459999 84.389999 115.300003
    2026-07-09 751.710022 110.510002 83.199997 116.849998
    2026-07-10 754.950012 111.639999 84.120003 117.239998
    2026-07-13 749.169983 111.589996 84.589996 116.040001
    2026-07-14 751.830017 111.449997 83.419998 115.900002
    2026-07-15 754.809998 113.379997 83.470001 117.000000
    2026-07-16 750.719971 112.650002 85.809998 117.339996
    2026-07-17 743.289978 110.650002 85.190002 115.440002
    2026-07-20 742.090027 110.800003 84.860001 114.610001
    2026-07-21 748.280029 110.029999 84.059998 114.870003
    2026-07-22 747.409973 109.199997 84.379997 114.019997
    2026-07-23 738.179993 105.379997 83.209999 108.760002
    2026-07-24 738.929993 NaN NaN NaN
    2026-07-27 739.090027 107.660004 85.360001 110.839996
    2026-07-28 NaN NaN NaN NaN
    yf.download('XLC', '2026-7-1')
    [100%
    ] 1 of 1 completed
    Price Close High Low Open Volume
    Ticker XLC XLC XLC XLC XLC
    Date
    2026-07-01 109.739998 110.839996 108.635002 109.029999 14529400
    2026-07-02 109.599998 110.010002 108.550003 109.610001 8388900
    2026-07-06 110.209999 110.375000 108.980003 110.074997 8938800
    2026-07-07 111.019997 112.269997 110.949997 111.669998 7882400
    2026-07-08 109.459999 110.985001 109.279999 110.919998 5527900
    2026-07-09 110.510002 110.595001 107.820000 108.080002 6444300
    2026-07-10 111.639999 112.160004 111.025002 111.720001 6465600
    2026-07-13 111.589996 112.760002 111.464996 111.779999 5851900
    2026-07-14 111.449997 111.830002 110.830002 110.830002 5061500
    2026-07-15 113.379997 113.860001 111.529999 111.699997 6245600
    2026-07-16 112.650002 114.029999 112.269997 113.599998 5648300
    2026-07-17 110.650002 111.510002 110.309998 111.199997 7677700
    2026-07-20 110.800003 111.660004 110.510002 110.815002 4011900
    2026-07-21 110.029999 110.620003 109.989998 110.529999 3944800
    2026-07-22 109.199997 111.105003 109.160004 110.910004 3998500
    2026-07-23 105.379997 106.959999 105.254997 106.959999 12517500
    2026-07-27 107.660004 108.540001 107.440002 107.519997 6668500
    2026-07-28 NaN NaN NaN NaN 5285452

  5. Josejsi commented on Jul 29, 2026

    @Josejsi

    I can confirm a very strange pattern in Yahoo's daily history.

    During the July 28 trading session, Yahoo was returning valid intraday daily bars for July 28. However, on July 29, those July 28 rows are still present but their OHLC and adjusted close values have become NaN, with volume set to zero.

    At the same time, Yahoo is already returning valid intraday bars for July 29 for symbols such as ^GSPC, ^IXIC, ^VIX, SPY, and QQQ.

    Examples observed on July 29 at 09:39 EDT:

    • SPY: July 28 row exists, but OHLC is NaN; July 29 already has a valid intraday bar.
    • QQQ: same behavior.
    • ^GSPC: July 28 row exists with NaN; July 29 has a valid intraday bar.
    • ^NYA: July 28 and July 29 rows exist, but both currently have NaN.
    • ^VIX3M: several consecutive sessions are present only as rows with NaN.

    This suggests that a valid intraday bar may later be replaced or regenerated as an empty daily row. Therefore, checking only whether the date exists is not sufficient; consumers must also validate that Close is numeric and non-null.

    This is causing daily ingestion pipelines to see the current session while the previous completed session remains invalid.

  6. plajos1 commented on Aug 4, 2026

    @plajos1
    Author

    It is strange if you use:

    yf.download(ticker, start=today, end=tomorrow, prepost=True)

    then the data is OK, but if the period is longer than one day, the last day will only show the volume. This means that yahoo gives the data, but there is an error in the handling of it. Currently the solution is to download the data in two steps:
    from start to day before yesterday and concat it with the last data which is read by the abovementioned method. I hope there will be a solution in the yfinance soon...

  7. plajos1 commented on Aug 18, 2026

    @plajos1
    Author

    Strange behaviour: running the program before ET 0:00:00 will give back the proper data for the last day. After that the last line filled with "nan"s and the proper volume value. During the day it changes and the OCHL data will appear in the last line too.

  8. plajos1 commented on Aug 18, 2026

    @plajos1
    Author

    If you use the 'repair' option, then the problem disappears:

    yf.download(ticker, start = start, end = end, repair=True)

  9. llninja1 commented on Aug 18, 2026

    @llninja1

    If you use the 'repair' option, then the problem disappears:

    yf.download(ticker, start = start, end = end, repair=True)

    I cannot get repair to work at all.

    yf.download('AEI')
    [100%**] 1 of 1 completed
    Out[2]:
    Price Close High Low Open Volume
    Ticker AEI AEI AEI AEI AEI
    Date
    2026-07-20 1.14 1.250 1.140 1.180 10700
    2026-07-21 1.14 1.190 1.140 1.160 3900
    2026-07-22 1.10 1.210 1.060 1.180 19800
    2026-07-23 1.08 1.150 1.060 1.060 7700
    2026-07-24 1.09 1.140 1.080 1.140 4500
    2026-07-27 1.05 1.140 1.050 1.140 5800
    2026-07-28 1.04 1.070 1.030 1.050 9100
    2026-07-29 1.05 1.050 1.030 1.040 10000
    2026-07-30 1.06 1.090 1.050 1.090 4600
    2026-07-31 1.02 1.055 1.000 1.050 8000
    2026-08-03 1.05 1.110 1.030 1.034 13300
    2026-08-04 1.09 1.280 1.070 1.070 24100
    2026-08-05 1.09 1.090 1.080 1.080 2100
    2026-08-06 1.24 1.240 1.110 1.140 11400
    2026-08-07 1.18 1.215 1.110 1.120 9100
    2026-08-10 1.07 1.140 1.050 1.120 6100
    2026-08-12 1.12 1.167 1.060 1.120 3200
    2026-08-13 1.17 1.200 1.090 1.090 30600
    2026-08-14 1.34 1.370 1.175 1.175 20000
    2026-08-17 NaN NaN NaN NaN 254027

    yf.download('AEI', repair=True)
    [100%**] 1 of 1 completed
    Out[3]:
    Empty DataFrame
    Columns: [(Adj Close, AEI), (Close, AEI), (High, AEI), (Low, AEI), (Open, AEI), (Volume, AEI)]
    Index: []

    yf.download('AEI', start='2026-06-20', repair=True)
    [100%**] 1 of 1 completed
    Out[4]:
    Empty DataFrame
    Columns: [(Adj Close, AEI), (Close, AEI), (High, AEI), (Low, AEI), (Open, AEI), (Volume, AEI)]
    Index: []

    yf.download('AEI', start='2026-06-20', end='2026-08-17', repair=True)
    [100%**] 1 of 1 completed
    Out[5]:
    Empty DataFrame
    Columns: [(Adj Close, AEI), (Close, AEI), (High, AEI), (Low, AEI), (Open, AEI), (Volume, AEI)]
    Index: []

  10. llninja1 commented on Aug 18, 2026

    @llninja1

    Interesing, there are also holes in the data from the 11th. At this point if it is Yahoo Finance and not yfinance, then I'm probably going to have to look into switching to another data service.

    yf.download('AEI RIVN AM SPY AAPL').Close
    [100%**] 5 of 5 completed
    Out[11]:
    Ticker AAPL AEI AM RIVN SPY
    Date
    2026-07-20 326.308563 1.14 22.366207 17.240000 742.090027
    2026-07-21 327.457581 1.14 22.277138 17.760000 748.280029
    2026-07-22 325.609192 1.10 22.613621 17.180000 747.409973
    2026-07-23 321.382843 1.08 22.771967 16.459999 738.179993
    2026-07-24 332.733032 1.09 22.514656 15.840000 738.929993
    2026-07-27 336.619690 1.05 21.742723 16.480000 739.090027
    2026-07-28 339.786926 1.04 21.525000 16.690001 740.859985
    2026-07-29 337.898590 1.05 21.520000 16.330000 729.460022
    2026-07-30 333.142670 1.06 21.549999 16.830000 741.690002
    2026-07-31 308.643829 1.02 21.969999 15.220000 747.030029
    2026-08-03 303.158569 1.05 21.980000 15.355000 757.669983
    2026-08-04 309.113403 1.09 21.850000 15.760000 771.330017
    2026-08-05 310.732025 1.09 21.160000 15.560000 769.789978
    2026-08-06 312.140808 1.24 21.490000 15.380000 768.559998
    2026-08-07 313.059998 1.18 21.270000 16.000000 773.260010
    2026-08-10 308.260010 1.07 21.940001 16.389999 773.030029
    2026-08-11 304.910004 NaN NaN 16.360001 770.559998
    2026-08-12 302.250000 1.12 22.240000 15.930000 772.489990
    2026-08-13 305.260010 1.17 22.080000 15.820000 777.880005
    2026-08-14 305.929993 1.34 22.549999 15.360000 776.340027
    2026-08-17 NaN NaN NaN NaN NaN

  11. Josejsi commented on Aug 18, 2026

    @Josejsi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions