BUG: Incompatible dype warning when assigning boolean series with logical indexer #57338
Open
3 tasks done
Labels
Bug
Indexing
Related to indexing on series/frames, not to indexes themselves
PDEP6-related
related to PDEP6 (not upcasting during setitem-like Series operations)
Milestone
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
The assignment
data1[condition] = data2[condition]
results in warning claiming incompatible types:Which is clearly not true.
This bug is somewhat related to the one reported in #56600, although the use case is different.
Interestingly, the problem disappears when using another dtype, such as int (code below works as expected, no warnings) :
Note: Reproduced on pandas==2.2.0 and 3.0.0.dev0+292.g70f367194a
Expected Behavior
There should be no warning.
Installed Versions
pandas : 3.0.0.dev0+292.g70f367194a
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.8.2
setuptools : 59.6.0
pip : 24.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.3
IPython : 8.21.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.8.2
numba : None
numexpr : None
odfpy : None
openpyxl : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.12.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.4
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: