Open seeohsee opened 3 years ago
Because depending on the index, some of them may be monthly reports, other weekly or "business-daily". They do not come from some standard vendor so they do not have to line up.
This is actually caused by dividend events not being merged properly. This PR will fix it https://github.com/ranaroussi/yfinance/pull/1069
Just for clarity ...
Sometimes the data I get back has dates listed as Mondays, sometimes Wednesdays, etc.
This is still an issue but caused by Yahoo. Solution is to shift start date back a few days to e.g. Saturday. Stupid but works. One day yfinance
will do weekly properly (there are other problems in Yahoo)
I don't think I understand how to properly pull weekly data with yfinance. I seem to get different dates in return depending on the start and end date I select. In reality, I just want M-F data in a single pandas dataframe row. Sometimes the data I get back has dates listed as Mondays, sometimes Wednesdays, etc. How can I just get a Monday-Friday trading week in return?
Further, it seems the data can be incomplete. For example, if I want to compare weekly data between two tickers for the same time period, the end result should (in theory) contain the same number of weekly data points. In reality, I get two different results. Here is an example:
Clearly, there are missing entries in df2 that exist in df1. How can I get the two dataframes to contain the same number of entries, with the exact same dates and row indices?
I can examine the differences, like: