DatetimeIndex min failure · Issue #1895 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@changhiskhan

Description

@changhiskhan

In [14]: rng = pd.date_range('2012-8-1', freq='T', periods=100)

In [15]: m = rng.min()

In [16]: m
Out[16]: ---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...

c:\code\pandas\pandas\tseries\index.py in __repr__(self)
    472
    473         summary = str(self.__class__)
--> 474         if len(self) == 1:
    475             first = _format_datetime64(values[0], tz=self.tz)
    476             summary += '\n[%s]' % first

TypeError: len() of unsized object

In [17]: type(m)
Out[17]: pandas.tseries.index.DatetimeIndex

In [20]: rng.asobject.min()
Out[20]: Index(<Timestamp: 2012-08-01 00:00:00>, dtype=object)