-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
datetime not properly converted from Series; timezone dropped #8259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
By definition
|
@benjschiller by definition a datetime that is tz-aware is |
I'm not sure I understand your comments. If you had a list of timezone-aware datetimes, how would you conveniently convert that into a time-zone aware pandas Series? |
|
It seems much more desirable to have an actual TimeSeries representation. a datetime64 ndarray is fine but for some reason pandas doesn't support the tz_localize and tz_convert methods of DateTimeIndex with this type (it's not clear to me why this is only desirable for an index). Basically, it should be possible to manipulate the time series as a whole (tz_localize, tz_convert, etc) without individually manipulating every element Also, this mucks up the convert_to_r_dataframe function, because it's expecting a datetime64 series as the correspondence to a POSX time vector in R, which is what everything in R wants for representing time. "object" Series are converted to strings. Of course, one could coerce the data, but it would be really nice if this stuff all worked according to a common design. |
hmm, not really sure what you are trying to do, but 0.14.1 and 0.15.0 (coming soon) have more support for series-like indexes. Of course if you would like to contribute a patch to better support tz-aware Series would be welcome. It is however a failry big implementation. I have no idea about the r conversion. |
Here's an issue: #8260 |
Alright, thanks. I'll see what I can whip together in the next couple weeks. For now I'll just use the fact that the datetime64 series is UTC to do the conversion in R |
gr8! timezones are tricky, but the |
This bug also happens if you use the .convert_objects() method of DataFrame or Series.
To reproduce:
The text was updated successfully, but these errors were encountered: