Index and Series min
and max
handles nan
and NaT
differently. Even though min
and max
are defined in IndexOpsMixin
, Series
doesn't use them and use NDFrame
definitions.
pd.Index([np.nan, 1.0]).min()
# nan
pd.Index([np.nan, 1.0]).max()
# nan
pd.DatetimeIndex([pd.NaT, '2011-01-01']).min()
# NaT
pd.DatetimeIndex([pd.NaT, '2011-01-01']).max()
#2011-01-01 00:00:00
# Series excludes nan and NaT
pd.Series([np.nan, 1.0]).min()
#1.0
pd.Series([np.nan, 1.0]).max()
#1.0
pd.Series([pd.NaT, pd.Timestamp('2011-01-01')]).min()
#2011-01-01 00:00:00
pd.Series([pd.NaT, pd.Timestamp('2011-01-01')]).max()
#2011-01-01 00:00:00
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