yfinance icon indicating copy to clipboard operation
yfinance copied to clipboard

Same call on different platform yields different results

Open drorata opened this issue 4 years ago • 3 comments

Consider the following minimal snippet.

import yfinance as yf
from pandas_datareader import data as pdr
yf.pdr_override()
res = pdr.get_data_yahoo("TCOM", start="2019-01-01", end="2021-06-20")

When ran on my local machine I get in 622 rows in the resulting dataframe. However, if running from within a docker image or a remote VM it returns 621 rows. Somehow, when running on my local machine the first row is dates 2018-12-31...

For both the local and "remote" environments I use the following requirements.txt:

pandas~=1.0
yfinance~=0.1
pandas_datareader~=0.8
pytest<7.0
loguru<0.6
beautifulsoup4~=4.9
python-dotenv<0.20
click<9.0

I'll be happy to provide more debugging information :) Thanks!

drorata avatar Jun 21 '21 20:06 drorata

I can imagine it is due to the fact that my local machine is in UTC+2 and the docker/VM environments are in UTC. But I don't see how to fix it.

drorata avatar Jun 21 '21 21:06 drorata

I just discovered that when replacing the ticker TCOM with CMCSA then the same number of rows is returned on both the local and docker environments.

drorata avatar Jun 22 '21 05:06 drorata

Timezone handling fixed in recent versions, can you confirm issue fixed

ValueRaider avatar Jan 06 '23 17:01 ValueRaider