From d621299b9138046a6a16d9a40f1c8dc171b4d7b5 Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Fri, 13 Jun 2014 22:26:25 -0700 Subject: [PATCH] DOC: Add how to calculate month-start to cookbook Related: #7449 --- doc/source/cookbook.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/source/cookbook.rst b/doc/source/cookbook.rst index 2548f2d88c5d9..b16c71bffd64d 100644 --- a/doc/source/cookbook.rst +++ b/doc/source/cookbook.rst @@ -269,6 +269,13 @@ Turn a matrix with hours in columns and days in rows into a continuous row seque `Dealing with duplicates when reindexing a timeseries to a specified frequency `__ +Calculate the first day of the month for each entry in a DatetimeIndex + +.. ipython:: python + + dates = pd.date_range('2000-01-01', periods=5) + dates.to_period(freq='M').to_timestamp() + .. _cookbook.resample: Resampling