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')
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'
Most helpful comment
make_future_dataframeis a pretty thin wrapper onpd.date_range. It supports a wide range offreqoptions which you can read about here: http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliasesYou 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.