A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/47809 below:

SparseArray.unique fails to keep original elements order · Issue #47809 · pandas-dev/pandas · GitHub

Pandas version checks Reproducible Example
# 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 3
Issue 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