BUG: DataFrame.min with skipna=True raises TypeError when column contains np.nan and datetime.date #61204
Open
3 tasks done
Labels
Bug
Missing-data
np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Reduction Operations
sum, mean, min, max, etc.
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 issue arises when calling DataFrame.min(axis=0) with skipna=True (default) on a column containing a mix of np.nan and datetime.date. This results in a TypeError because np.nan (a float) cannot be compared with datetime.date.
This issue is related to issue #61187, but the specific case here involves datetime.date (not datetime.datetime), which behaves differently in pandas.
Expected Behavior
Installed Versions
INSTALLED VERSIONS
commit : 0691c5c
python : 3.12.7
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19045
machine : AMD64
processor : Intel64 Family 6 Model 85 Stepping 7, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : English_United States.1252
pandas : 2.2.3
numpy : 2.2.3
pytz : 2025.1
dateutil : 2.9.0
pip : 24.2
Cython : None
sphinx : None
IPython : None
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 : None
lxml.etree : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.5
pandas_gbq : 0.28.0
psycopg2 : None
pymysql : None
pyarrow : 19.0.1
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.15.2
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : 3.2.2
zstandard : None
tzdata : 2025.1
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: