pydata/pandas — pull request #8184 by jreback (2014-09-05 14:37:21+00:00)
Title: WPI: create Timedelta scalar / TimedeltaIndex

closes #3009

This PR creates a new ``timedelta`` sub-class, the scalar ``Timedelta``, very similar to how ``Timestamp`` sub-classes ``datetime``. Further it creates a ``TimedeltaIndex`` modelled on ``DatetimeIndex`` that holds the underlying data (boxing is only on iteration).

- ToDo
- Document API changes:
- [ ] ``to_timedelta` return ``TimedeltaIndex`` rather than a ``Series``
- [ ] Boxing for ``list(Series(...))`` is now ``Timedelta``
- [ ] usage / examples
- Timedelta
- [ ] conversions ``to_timedelta``,``to_timedelta64``
- [ ] what else needs boxing in Series?
- [ ] fix formatters (Timedelta64Formatter; remove ``repr_timedelta64`` (no longer necessary)
- [ ] create ``timedelta_range`` & fix freq / inferred_freq
- [ ] fix remaining copied methods from DatetimeIndex
- more tests (of TimedeltaIndex / scalar)
- [ ] scalar comparisons
- [ ] index comparisons
- [ ] getitem / partial string access
- [ ] sql expecting ``np.timedelta64`` ?