-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: 1.3.0rc1 pd.util.hash_array on Index fails to access _values_for_factorize #42003
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
hash_array is only supposed to get ndarray or ExtensionArray (see the annotation) |
I'm sorry I'm not sure what annotation you're referring to? It does look this is WAI though, and I should prefer Would a cleaner error message be a welcome change here? |
The annotation for
Yes, that should accept Indexes just fine. |
sure |
the code sample in the OP includes a tz. so that is not a change in 1.3.0rc1 |
The public api for The docstring has been updated in #39949 and the api widened to accept any EA and numpy array. https://pandas.pydata.org/pandas-docs/version/1.3/reference/api/pandas.util.hash_array.html so Index is not an accepted input. but maybe we should also add something to the 1.3 release notes since it worked for some Index types before. @jbrockmendel? |
makes sense |
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas. (does not exist in 1.2.4, only seen in 1.3.0rc1 and master)
(optional) I have confirmed this bug exists on the master branch of pandas. (confirmed on 0b68d87)
Code Sample, a copy-pastable example
Problem description
This issue looks similar to #41817, but that is specifically for DateTimeIndex with tz defined, while this seems to happen for any Index instance.
Expected Output
A hash of the input index, as in pandas < 1.3.0.
Output of
pd.show_versions()
pandas : 1.3.0rc1
numpy : 1.19.5
pytz : 2021.1
dateutil : 2.8.1
pip : 20.2.1
setuptools : 49.2.1
Cython : 0.29.22
pytest : 6.2.2
hypothesis : 6.4.0
sphinx : 3.5.1
blosc : 1.10.2
feather : None
xlsxwriter : 1.3.7
lxml.etree : 4.6.2
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.3
IPython : 7.21.0
pandas_datareader: None
bs4 : 4.9.3
bottleneck : 1.3.2
fsspec : 0.8.7
fastparquet : 0.5.0
gcsfs : 0.7.2
matplotlib : 3.3.4
numexpr : 2.7.3
odfpy : None
openpyxl : 3.0.6
pandas_gbq : None
pyarrow : 3.0.0
pyxlsb : None
s3fs : 0.5.2
scipy : 1.6.1
sqlalchemy : 1.3.23
tables : 3.6.1
tabulate : 0.8.9
xarray : 0.17.0
xlrd : 2.0.1
xlwt : 1.3.0
numba : 0.52.0
The text was updated successfully, but these errors were encountered: