A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/46471 below:

`.fillna(-1)` does not work in `pd.eval` · Issue #46471 · pandas-dev/pandas · GitHub

Pandas version checks Reproducible Example
import pandas as pd
def test_unary(val):
    df = pd.DataFrame({'x': np.array([0.11, 0], dtype=np.float32)})
    res = df.eval(f'x=x.fillna({val})')
test_unary(1)  # works
test_unary(-1)  # fails
Issue Description

.eval seems to be having some problems with negative values. A very similar issue has been reported, summarized and closed here: #16363

However, it clearly still persists in other instances.

Expected Behavior

test_unary(-1) # works

Installed Versions INSTALLED VERSIONS

commit : 66e3805
python : 3.9.10.final.0
python-bits : 64
OS : Linux
OS-release : 5.13.0-35-generic
Version : #40~20.04.1-Ubuntu SMP Mon Mar 7 09:18:32 UTC 2022
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.3.5
numpy : 1.21.2
pytz : 2021.3
dateutil : 2.8.2
pip : 21.3.1
setuptools : 58.2.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.0.2
IPython : 7.28.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : 2021.11.1
fastparquet : None
gcsfs : None
matplotlib : 3.4.3
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 5.0.0
pyxlsb : None
s3fs : 2021.11.1
scipy : 1.7.1
sqlalchemy : 1.4.25
tables : None
tabulate : 0.8.9
xarray : None
xlrd : None
xlwt : None
numba : 0.55.0


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4