Open aisthesis opened 9 years ago
>>> dsum = dailysummary.summarize() # DataFrame derived from what is retrieved by Pandas
>>> pd.to_datetime(dsum.loc['Quote_Time'].values[0]).tz_convert('Europe/Berlin')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pandas/tslib.pyx", line 444, in pandas.tslib.Timestamp.tz_convert (pandas/tslib.c:10218)
TypeError: Cannot convert tz-naive Timestamp, use tz_localize to localize
Pandas is still debating what behavior they intend to use. Let's leave this issue open until they reach a reliable solution, which may even fix the problem.
Timezone should in this case be in 'US/Eastern' to simplify questions having to do with market closings (EDT vs. EST) and given that quote times are in actuality US Eastern time. The dataframe, however, pulls them from Yahoo as tz-naive times, and that is passed along in my use case to the BSON object stored in Mongo. These should all be cleaned up to be aware that the time zone is US/Eastern.
Related: