pandas.date_range() is one of the core functions in Pandas that is used to return a fixed DatetimeIndex frequency.
Syntax: pandas.date_range (start = None, end = None, periods = None, freq = None, tz = None, normalize = False, name = None, closed = None, ** kwargs)
start: Left bound for generating dates.
end: Right bound for generating dates .
periods: Number of periods to generate.
freq: Frequency strings can have multiples, eg ’5H’. See here for a list of frequency aliases.
tz: Time zone name for returning localized DatetimeIndex. By default, the resulting DatetimeIndex is timezone-naive.
normalize: Normalize start / end dates to midnight before generating date range.
name: Name of the resulting DatetimeIndex.
closed: Make the interval closed with respect to the given frequency to the ’left’, ’right’, or both sides (None, the default).
Code # 1:
Code # 2:
Code # 3:
Code # 4: