You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apparently datetime64[ns, Europe/Berlin] is an extension array dtype but has no _values_for_factorize method. I've reproduced on pandas 1.1.4, 1.2.4, and on master (503ce50)
Problem description
pd.util.hash_array works with other Indexes, including a timezone-naive DatetimeIndex, it seems reasonable to expect it to work with a timezone-aware DatetimeIndex (or yield a better error).
Expected Output
Output should be similar to timezone-naive DatetimeIndex:
In [3]: pd.util.hash_array(pd.DatetimeIndex(['2018-10-28 01:20:00']))
Out[3]: array([3152239034440746192], dtype=uint64)
The text was updated successfully, but these errors were encountered:
TheNeuralBit
changed the title
BUG:pd.util.hash_array fails on DatetimeIndex with tz specified
BUG: pd.util.hash_array fails on DatetimeIndex with tz specified
Jun 4, 2021
Closing this as it duplicates #42003. In both cases I should be using pd.util.hash_pandas_object instead. Will track a possible error message improvement in the other bug.
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Output:
Apparently
datetime64[ns, Europe/Berlin]
is an extension array dtype but has no_values_for_factorize
method. I've reproduced on pandas 1.1.4, 1.2.4, and on master (503ce50)Problem description
pd.util.hash_array
works with other Indexes, including a timezone-naiveDatetimeIndex
, it seems reasonable to expect it to work with a timezone-awareDatetimeIndex
(or yield a better error).Expected Output
Output should be similar to timezone-naive
DatetimeIndex
:The text was updated successfully, but these errors were encountered: