Prophet: make_future_dataframe freq 'M' generated data is odd

Created on 9 Jun 2017  路  2Comments  路  Source: facebook/prophet

when I use make_future_dataframe with param freq='M', the dates generated is the last day of the month,It's strange.How about use shift method to get the first day of the month predicated?like
dates = pd.date_range(
start=last_date,
periods=periods + 1, # An extra in case we include start
freq=freq).shift(1, freq='D')

Most helpful comment

make_future_dataframe is a pretty thin wrapper on pd.date_range. It supports a wide range of freq options which you can read about here: http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases

You can get first day of the month with 'MS'. I agree that first day of the month seems more natural than last, but since this is the pandas default I'm inclined to not try and override it.

All 2 comments

make_future_dataframe is a pretty thin wrapper on pd.date_range. It supports a wide range of freq options which you can read about here: http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases

You can get first day of the month with 'MS'. I agree that first day of the month seems more natural than last, but since this is the pandas default I'm inclined to not try and override it.

use freq = 'MS'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidjayjackson picture davidjayjackson  路  3Comments

xiaoyaoyang picture xiaoyaoyang  路  3Comments

arnaudvl picture arnaudvl  路  3Comments

ChaymaeHarfoush picture ChaymaeHarfoush  路  3Comments

robertdknight picture robertdknight  路  3Comments