-
-
Notifications
You must be signed in to change notification settings - Fork 19k
Description
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
import pandas as pd
df = pd.DataFrame(data=[
{"a": 1, "b": None},
{"a": 2, "b": None},
])
df.groupby("b", dropna=False).filter(lambda x: True)
Issue Description
Expected to return the full df, but it returns an empty df instead. Also inconsistent behavior when the first row, b
col is changed to a number e.g. 10 (The row with None value is not returned) vs when it is changed to a string e.g. "a" (The row with None value is returned)
Expected Behavior
Expect it to return the full dataframe but it returns an empty df instead.
Installed Versions
pandas : 2.3.2
numpy : 1.24.4
pytz : 2022.1
dateutil : 2.8.2
pip : 22.2.2
Cython : 0.29.32
sphinx : None
IPython : 8.10.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.6
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 : 2025.2
qtpy : None
pyqt5 : None
/databricks/python/lib/python3.10/site-packages/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")