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.
# 1.4.3 >>> arr = SparseArray([np.nan, 1.0, 0, 0, np.nan, 2], fill_value=1.0) >>> arr.unique() [nan, 0.0, 2.0, 1.0] Fill: 1.0 IntIndex Indices: array([0, 1, 2]) # main IndexError: index 5 is out of bounds for axis 0 with size 3Issue Description
#46287 changes the implementation for SparseArray.unique, which raises for non-default fill_value. (Actually the original one in 1.4.3 is also not correct.)
Expected Behavior>>> arr.unique()
[nan, 1.0, 0.0, 2.0]
Fill: 1.0
IntIndex
Indices: array([0, 2, 3])
Installed Versions main
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4