Open thirtythreeforty opened 3 years ago
Hi @thirtythreeforty , thanks for the detailed report.
In the short-term, I would advise using the non-dataframe oriented API to download the raw data and parse them into datetimes using your own preferred logic, since that API is simpler, and doesn't attempt to do any type related data coercion.
client.get_ticker_price('AAPL', ...)
Possibly related is the following interesting behavior, unexpected to me. By querying an interval of 2 minutes, I would expect 2 (or 3) minutes but for some reason I get a dataframe with 10 rows, starting with the correct date/time but ending with a time of 15:59
start = '2023-03-15 15:50:00'
end = '2023-03-15 15:52:00'
df = tiingo_client.get_dataframe(
tickers='QQQ', frequency='1min', startDate=start, endDate=end
)
df
Description
Was trying to download IEX intraday by walking backward through dates.
What I Did
This happens because when the code tries to convert the index to_datetime, pandas returns a plain
Index
:https://github.com/hydrosquall/tiingo-python/blob/6b032a0219290e1c37878687f2316c6c4c6cdb10/tiingo/api.py#L212-L217
...presumably because it can't work out the correct timezone of the data, since it has the DST cutover, sample: