[Pandas-dev] Datetime (with timezone?) as extension array?

Tom Augspurger tom.augspurger88 at gmail.com
Tue Aug 14 07:13:54 EDT 2018


The discussion on datetime with timezone has been a bit scattered. I don't
think there's a single issue with everyone's thoughts.

There will be a DatetimeWithTZ array that implements the EA interface.
Anywhere we're internally using a DatetimeIndex as a
container for datetimes with timezones will use the new EA.

The unclear part is what `Series[datetime_with_tz].values` should be.
Currently, we convert to UTC, strip the timezone, and return
a datetime64[ns] ndarray. Changing that would be disruptive, jarringly
different from `Series[datetime].values` (no tz) and of little
value I think.

Tom

On Tue, Aug 14, 2018 at 4:07 AM Pietro Battiston <me at pietrobattiston.it>
wrote:

> Hi all,
>
> I assumed that Datetime (with timezone, or maybe in general?) was also
> planned to follow the extension array interface, which is related to
> issue https://github.com/pandas-dev/pandas/issues/19041 , to the
> annoying fact that datetimeindexwithtz._values returns the index
> itself, and also to the fact that
> https://pandas.pydata.org/pandas-docs/stable/extending.html
> currently states "Pandas itself uses the extension system for some
> types that aren’t built into NumPy (categorical, period, interval,
> datetime with timezone).", which is false.
>
> ... but I didn't find an issue for this? Did I miss it? Should I create
> it? Or was there a decision to leave datetimeindextz as it is, maybe
> for better compatibility with numpy?
>
> Pietro
> _______________________________________________
> Pandas-dev mailing list
> Pandas-dev at python.org
> https://mail.python.org/mailman/listinfo/pandas-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pandas-dev/attachments/20180814/a0888d49/attachment.html>


More information about the Pandas-dev mailing list