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