pydata/pandas — pull request #2990 by jreback (2013-03-07 13:31:21+00:00)
Title: ENH: support min/max on timedelta64[ns] Series

closes GH #2989

```
In [168]: df = DataFrame(dict(A = s - Timestamp('20120101')-timedelta(minutes=5,seconds=5),
.....: B = s - Series(date_range('2012-1-2', periods=3, freq='D'))))
.....:

In [169]: df
Out[169]:
A B
0 -00:05:05 -1 days, 00:00:00
1 23:54:55 -1 days, 00:00:00
2 1 days, 23:54:55 -1 days, 00:00:00

In [170]: df.min()
Out[170]:
A -00:05:05
B -1 days, 00:00:00
dtype: timedelta64[ns]

In [171]: df.min(axis=1)
Out[171]:
0 -1 days, 00:00:00
1 -1 days, 00:00:00
2 -1 days, 00:00:00
dtype: timedelta64[ns]

In [172]: df.idxmin()
Out[172]:
A 0
B 0
dtype: int64

In [173]: df.idxmax()
Out[173]:
A 2
B 0
dtype: int64

min, max operations are support on series, these return timedeltas. idxmin, idxmax are supported as well.

In [174]: df.min().max()
Out[174]: datetime.timedelta(-1, 86095)

In [175]: df.min(axis=1).min()
Out[175]: datetime.timedelta(-1)

In [176]: df.min().idxmax()
Out[176]: 'A'

In [177]: df.min(axis=1).idxmin()
Out[177]: 0
```