Python | pandas.date_range() method
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
pandas.date_range() is one of the general functions in Pandas which is used to return a fixed frequency DatetimeIndex.
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, e.g. ‘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).
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course