Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions doc/source/timeseries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,25 @@ The ``rollforward`` and ``rollback`` methods do exactly what you would expect:
It's definitely worth exploring the ``pandas.tseries.offsets`` module and the
various docstrings for the classes.

These operations (``apply``, ``rollforward`` and ``rollback``) preserves time (hour, minute, etc) information by default. To reset time, use ``normalize=True`` keyword when create offset instance. If ``normalize=True``, result is normalized after the function is applied.


.. ipython:: python

day = Day()
day.apply(Timestamp('2014-01-01 09:00'))

day = Day(normalize=True)
day.apply(Timestamp('2014-01-01 09:00'))

hour = Hour()
hour.apply(Timestamp('2014-01-01 22:00'))

hour = Hour(normalize=True)
hour.apply(Timestamp('2014-01-01 22:00'))
hour.apply(Timestamp('2014-01-01 23:00'))


Parametric offsets
~~~~~~~~~~~~~~~~~~

Expand Down
10 changes: 10 additions & 0 deletions doc/source/v0.14.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,18 @@ API changes



- All ``offsets`` suppports ``normalize`` keyword to specify whether ``offsets.apply``, ``rollforward`` and ``rollback`` resets time (hour, minute, etc) or not (default ``False``, preserves time) (:issue:`7156`)


.. ipython:: python

import pandas.tseries.offsets as offsets

day = offsets.Day()
day.apply(Timestamp('2014-01-01 09:00'))

day = offsets.Day(normalize=True)
day.apply(Timestamp('2014-01-01 09:00'))



Expand Down
Loading