We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
import pandas as pd arr_int = pd.array([1, 2, 3]) # Int64Dtype() => ExtensionArray arr_complex = pd.array([1+1j, 2, 3]) # NumpyEADtype('complex128') => NumpyExtensionArray pd.unique(arr_int) # OK pd.unique(arr_complex) # NOK: TypeError: unique requires a Series, Index, ExtensionArray, or np.ndarray, got NumpyExtensionArray.
This issue is similar to #59177 and is coming from pint-pandas where test CI job with nightly builds from pandas was recently introduced (pint-pandas issue related to skipped tests to pass tests with pandas 3).
pint-pandas
The above example is fine with pandas 2.2.2 but fails with pandas nightlies
The above mentionned TypeError is coming from
TypeError
pandas/pandas/core/algorithms.py
Line 222 in ab433af
As explained in #59177 NumpyExtensionArray may be used internally when other type of ExtensionArray are not available.
NumpyExtensionArray
ExtensionArray
for pandas 2.2.2 pd.unique returns:
pd.unique
>>> pd.unique(arr_complex) array([1.+1.j, 2.+0.j, 3.+0.j])
While we expect
>>> pd.unique(arr_complex) <NumpyExtensionArray> [(1+1j), (2+0j), (3+0j)] Length: 3, dtype: complex128
Replace this line with the output of pd.show_versions()
The text was updated successfully, but these errors were encountered:
take
Sorry, something went wrong.
Added a similar PR like #59181
ritwizsinha
Successfully merging a pull request may close this issue.
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
This issue is similar to #59177 and is coming from
pint-pandas
where test CI job with nightly builds from pandas was recently introduced (pint-pandas issue related to skipped tests to pass tests with pandas 3).The above example is fine with pandas 2.2.2 but fails with pandas nightlies
The above mentionned
TypeError
is coming frompandas/pandas/core/algorithms.py
Line 222 in ab433af
As explained in #59177
NumpyExtensionArray
may be used internally when other type ofExtensionArray
are not available.Expected Behavior
for pandas 2.2.2
pd.unique
returns:While we expect
Installed Versions
Replace this line with the output of pd.show_versions()
The text was updated successfully, but these errors were encountered: