-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BUG: SparseArray doesn't recalculate indices after comparison with scalar #44956
Closed
3 tasks done
Comments
bdrum
added
Bug
Needs Triage
Issue that has not been reviewed by a pandas team member
labels
Dec 18, 2021
4 tasks
bdrum
added a commit
to bdrum/pandas
that referenced
this issue
Dec 21, 2021
BUG: unary operators for SparseArray doesn't recalc indexes(pandas-dev#44956)
bdrum
added a commit
to bdrum/pandas
that referenced
this issue
Dec 21, 2021
BUG: unary operators for SparseArray doesn't recalc indexes(pandas-dev#44956)
bdrum
added a commit
to bdrum/pandas
that referenced
this issue
Dec 21, 2021
BUG: unary operators for SparseArray doesn't recalc indexes(pandas-dev#44956)
bdrum
added a commit
to bdrum/pandas
that referenced
this issue
Dec 21, 2021
BUG: unary operators for SparseArray doesn't recalc indexes(pandas-dev#44956)
bdrum
added a commit
to bdrum/pandas
that referenced
this issue
Dec 21, 2021
BUG: unary operators for SparseArray doesn't recalc indexes(pandas-dev#44956)
SparseArray.isna has fixed #44955 as well as unary operators. s = pd.arrays.SparseArray([np.nan,2,3,4,0,0,0],fill_value=0)
s
#[nan, 2.0, 3.0, 4.0, 0, 0, 0]
#Fill: 0
#IntIndex
#Indices: array([0, 1, 2, 3])
s.isna()
#[True, False, False, False, False, False, False]
#Fill: False
#IntIndex
#Indices: array([0]) |
Close as appeared fixed. |
@mroeschke Sorry, I confused you. |
mroeschke
added
Sparse
Sparse Data Type
and removed
Needs Triage
Issue that has not been reviewed by a pandas team member
labels
Dec 28, 2021
3 tasks
bdrum
added a commit
to bdrum/pandas
that referenced
this issue
Dec 30, 2021
4 tasks
bdrum
added a commit
to bdrum/pandas
that referenced
this issue
Dec 30, 2021
bdrum
added a commit
to bdrum/pandas
that referenced
this issue
Jan 1, 2022
bdrum
changed the title
BUG: SparseArray doesn't recalculate indices in some cases
BUG: SparseArray doesn't recalculate indices after comparing with scalar
Jan 1, 2022
bdrum
changed the title
BUG: SparseArray doesn't recalculate indices after comparing with scalar
BUG: SparseArray doesn't recalculate indices after comparison with scalar
Jan 1, 2022
bdrum
added a commit
to bdrum/pandas
that referenced
this issue
Jan 4, 2022
bdrum
added a commit
to bdrum/pandas
that referenced
this issue
Jan 4, 2022
bdrum
added a commit
to bdrum/pandas
that referenced
this issue
Jan 5, 2022
jreback
pushed a commit
that referenced
this issue
Jan 8, 2022
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 master branch of pandas.
Reproducible Example
Issue Description
I've been working on one issue and noticed that SparseArray doesn't recalculate sp_index when it required. E.g. on example above. Also in some specific case when fill_value is not na, but array contains na.
If you don't mind I would like to take this issue.
Expected Behavior
I think that correct behavior is SparseArray with automatically recalculated indices, e.g.
Installed Versions
pandas : 1.4.0.dev0+1415.g47eb219889
numpy : 1.21.2
pytz : 2021.3
dateutil : 2.8.2
pip : 21.3
setuptools : 58.0.4
Cython : 0.29.24
pytest : 6.2.5
hypothesis : 6.23.3
sphinx : 4.2.0
blosc : None
feather : None
xlsxwriter : 3.0.1
lxml.etree : 4.6.3
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.3
IPython : 7.28.0
pandas_datareader: None
bs4 : 4.10.0
bottleneck : 1.3.2
fsspec : 2021.10.1
fastparquet : None
gcsfs : 2021.10.1
matplotlib : 3.4.3
numexpr : 2.7.3
odfpy : None
openpyxl : 3.0.9
pandas_gbq : None
pyarrow : 5.0.0
pyxlsb : None
s3fs : 2021.10.1
scipy : 1.7.1
sqlalchemy : 1.4.25
tables : 3.6.1
tabulate : 0.8.9
xarray : None
xlrd : 2.0.1
xlwt : 1.3.0
numba : 0.53.1
The text was updated successfully, but these errors were encountered: