BUG: Inplace DataFrame.mask
not working on 2.0.0rc0 on mixed-type DataFrame.
#51685
Closed
2 of 3 tasks
Labels
Bug
Indexing
Related to indexing on series/frames, not to indexes themselves
Regression
Functionality that used to work in a prior pandas version
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 reasons I believe this is a bug in 2.0.0rc0 are:
inplace=True
from the pd.DataFrame.mask invocation, it works. Same behavior, except for the result being in a copy of course.inplace=True
andinplace=False
work properly.other=np.nan
, which is strange.Perhaps the behavior of the inplace masking in 2.0.0rc0 is correct, in which case I believe the
inplace=False
case should be consistent with it and equally fail.Expected Behavior
The
df
DataFrame should look like the following, after the inplace masking. Just like it did in Pandas 1.5.4, or like it does in Pandas 2.0.0rc0 with inplace=False.Thanks for all the great work on Pandas! And apologies if this is duplicated or not an issue (and a misuse of the library on my part), this is my first opened issue on the repository.
Installed Versions
INSTALLED VERSIONS
commit : 1a2e300
python : 3.9.12.final.0
python-bits : 64
OS : Linux
OS-release : 5.19.0-32-generic
Version : #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jan 30 17:03:34 UTC 2
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.0.0rc0
numpy : 1.24.2
pytz : 2022.7.1
dateutil : 2.8.2
setuptools : 58.1.0
pip : 23.0.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : None
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: