-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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: iloc
with Series
as indexer fails for __getitem__
but works with __setitem__
#60994
Comments
take |
Thanks for the report. This was discussed in #3631, I think the conclusion from that was we'd be okay supporting Boolean masks in
|
@rhshadrach if the conclusion is that boolean masks should be supported in |
I also think implementing |
@mroeschke - indeed, I somehow negated the conclusion I was going for. Agreed |
@jbrockmendel - any opposition to having |
if by "mask" you mean ndarray, then im totally on board. if you mean Series[bool] then im concerned about the case where key has a non-matching index. |
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
Behavior of
loc
with aSeries
as argument shows inconsistent behavior for__getitem__
and__setitem__
Expected Behavior
Either both
__getitem__
and__setitem__
should work or both should failInstalled Versions
pandas : 2.2.3
numpy : 2.2.2
pytz : 2024.2
dateutil : 2.9.0.post0
pip : 24.3.1
Cython : None
sphinx : 8.1.3
IPython : 8.31.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.5
lxml.etree : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : None
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2024.2
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: