We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
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.
import pandas as pd data = {'cd_tip_fma_pgto': [pd.NA]} df = pd.DataFrame(data, dtype='double[pyarrow]') df['payment'] = np.nan df['payment'] = df['payment'].mask(cond=(df['cd_tip_fma_pgto'] == 6), other='Livelo')
Evaluating the mask method under a pd.NA, when using pyarrow, is changing the target value!
The results of the compasison should not cause any change of the target value, as you see in this example :
data = {'cd_tip_fma_pgto': [pd.NA]} df = pd.DataFrame(data) df['payment'] = np.nan df['payment'] = df['payment'].mask(cond=(df['cd_tip_fma_pgto'] == 6), other='Livelo')
commit : 0691c5c python : 3.11.0 python-bits : 64 OS : Linux OS-release : 3.10.0-1127.19.1.el7.x86_64 Version : #1 SMP Tue Aug 25 17:23:54 UTC 2020 machine : x86_64 processor : x86_64 byteorder : little LC_ALL : None LANG : None LOCALE : en_US.UTF-8
pandas : 2.2.3 numpy : 1.24.2 pytz : 2022.7.1 dateutil : 2.8.2 pip : 25.1.1 Cython : 0.29.33 sphinx : None IPython : 8.10.0 adbc-driver-postgresql: None adbc-driver-sqlite : None bs4 : 4.11.2 blosc : None bottleneck : None dataframe-api-compat : None fastparquet : None fsspec : 2024.5.0 html5lib : None hypothesis : None gcsfs : None jinja2 : 3.1.2 lxml.etree : 4.9.2 matplotlib : None numba : None numexpr : None odfpy : None openpyxl : 3.1.3 pandas_gbq : None psycopg2 : None pymysql : None pyarrow : 17.0.0 pyreadstat : None pytest : 7.4.3 python-calamine : None pyxlsb : None s3fs : None scipy : 1.10.1 sqlalchemy : 2.0.30 tables : None tabulate : None xarray : None xlrd : None xlsxwriter : None zstandard : None tzdata : 2024.1 qtpy : N/A pyqt5 : None
The text was updated successfully, but these errors were encountered:
I think that my issue is similar to the Issue 60729
Sorry, something went wrong.
No branches or pull requests
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
Evaluating the mask method under a pd.NA, when using pyarrow, is changing the target value!
Expected Behavior
The results of the compasison should not cause any change of the target value, as you see in this example :
Installed Versions
INSTALLED VERSIONS
commit : 0691c5c
python : 3.11.0
python-bits : 64
OS : Linux
OS-release : 3.10.0-1127.19.1.el7.x86_64
Version : #1 SMP Tue Aug 25 17:23:54 UTC 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : None
LOCALE : en_US.UTF-8
pandas : 2.2.3
numpy : 1.24.2
pytz : 2022.7.1
dateutil : 2.8.2
pip : 25.1.1
Cython : 0.29.33
sphinx : None
IPython : 8.10.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.11.2
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.5.0
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.2
lxml.etree : 4.9.2
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.3
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : 17.0.0
pyreadstat : None
pytest : 7.4.3
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.10.1
sqlalchemy : 2.0.30
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2024.1
qtpy : N/A
pyqt5 : None
The text was updated successfully, but these errors were encountered: