How to stop yfinance from giving me back a row with empty NaN values?

See original GitHub issue

Greetings,

is there a reason why sometimes when I use a bulk download, such as data = pdr.get_data_yahoo(tickers, start= weeks52, end=today)

image

I get a row of data with NaN values? I understand that yfinance only updates closing data. I have never had to deal with NaN row from yfinance so im a little bewildered.

Usually yfinance only returns back the most recent market data that is available. This hasn’t caused me any trouble in the passed except for today… I’ve also noticed that this only appears to be an issue when I download data for multiple tickers. The ticker variable above is a list of 500 stocks.

How can this be solved from my end? I know this is not too big of an issue as I can just ignore the row with NaN values. But I’m automating a program that assumes the dataframe index position for most recent data will always be the same.

Anyone else experiencing something similar?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

4reactions
GF-Huangcommented, Feb 23, 2021

This is a BUG. Nobody to fix it. Even if there is PR, it is never merged. 👎

1reaction
ValueRaidercommented, Sep 20, 2022

My timezone fixes should resolve this issue, which I will personally merge in soon once it’s been sufficiently tested. https://github.com/ranaroussi/yfinance/pull/1048

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to trim columns with NaN while concatenating two series
For instance this post answers a very similar question. First, you need to assign the result of the concat() call to a variable,...
Read more >
yfinance Library - A Complete Guide - AlgoTrading101 Blog
If in this case Yahoo Finance was to change the class ID pointing to this value, the method might return completely incorrect data,...
Read more >
How to Identify and Drop Null Values for Handling Missing ...
Python pandas tutorial for finding missing values in python pandas dataframe and then dropping those null value to clean the dataset.
Read more >
Reliably download historical market data from Yahoo! Finance ...
Ever since Yahoo! Finance decommissioned their historical data API, ... version of yfinance is a complete re-write of the libray, offering a ...
Read more >
A Better Way to Handle Missing Values in your Dataset
yfinance is a package used to download historical market data of stocks from ... Okay, now going back to the dataframe, you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found