@@ -292,8 +292,8 @@ def __new__(cls, data=None,
292292 if is_float (periods ):
293293 periods = int (periods )
294294 elif not is_integer (periods ):
295- raise ValueError ( 'Periods must be a number, got %s' %
296- str ( periods ))
295+ msg = 'periods must be a number, got {periods}'
296+ raise ValueError ( msg . format ( periods = periods ))
297297
298298 if data is None and freq is None :
299299 raise ValueError ("Must provide freq argument if no data is "
@@ -412,7 +412,7 @@ def __new__(cls, data=None,
412412 def _generate (cls , start , end , periods , name , offset ,
413413 tz = None , normalize = False , ambiguous = 'raise' , closed = None ):
414414 if com ._count_not_none (start , end , periods ) != 2 :
415- raise ValueError ('Of the three parameters, start, end, and '
415+ raise ValueError ('Of the three parameters: start, end, and '
416416 'periods, exactly two must be specified' )
417417
418418 _normalized = True
@@ -2005,7 +2005,7 @@ def _generate_regular_range(start, end, periods, offset):
20052005def date_range (start = None , end = None , periods = None , freq = 'D' , tz = None ,
20062006 normalize = False , name = None , closed = None , ** kwargs ):
20072007 """
2008- Return a fixed frequency datetime index , with day (calendar) as the default
2008+ Return a fixed frequency DatetimeIndex , with day (calendar) as the default
20092009 frequency
20102010
20112011 Parameters
@@ -2014,24 +2014,24 @@ def date_range(start=None, end=None, periods=None, freq='D', tz=None,
20142014 Left bound for generating dates
20152015 end : string or datetime-like, default None
20162016 Right bound for generating dates
2017- periods : integer or None , default None
2018- If None, must specify start and end
2017+ periods : integer, default None
2018+ Number of dates to generate
20192019 freq : string or DateOffset, default 'D' (calendar daily)
20202020 Frequency strings can have multiples, e.g. '5H'
2021- tz : string or None
2021+ tz : string, default None
20222022 Time zone name for returning localized DatetimeIndex, for example
20232023 Asia/Hong_Kong
20242024 normalize : bool, default False
20252025 Normalize start/end dates to midnight before generating date range
2026- name : str , default None
2027- Name of the resulting index
2028- closed : string or None , default None
2026+ name : string , default None
2027+ Name of the resulting DatetimeIndex
2028+ closed : string, default None
20292029 Make the interval closed with respect to the given frequency to
20302030 the 'left', 'right', or both sides (None)
20312031
20322032 Notes
20332033 -----
2034- Of the three parameters, ``start``, ``end``, and ``periods``, exactly two
2034+ Of the three parameters: ``start``, ``end``, and ``periods``, exactly two
20352035 must be specified.
20362036
20372037 To learn more about the frequency strings, please see `this link
@@ -2049,7 +2049,7 @@ def date_range(start=None, end=None, periods=None, freq='D', tz=None,
20492049def bdate_range (start = None , end = None , periods = None , freq = 'B' , tz = None ,
20502050 normalize = True , name = None , closed = None , ** kwargs ):
20512051 """
2052- Return a fixed frequency datetime index , with business day as the default
2052+ Return a fixed frequency DatetimeIndex , with business day as the default
20532053 frequency
20542054
20552055 Parameters
@@ -2058,24 +2058,24 @@ def bdate_range(start=None, end=None, periods=None, freq='B', tz=None,
20582058 Left bound for generating dates
20592059 end : string or datetime-like, default None
20602060 Right bound for generating dates
2061- periods : integer or None , default None
2062- If None, must specify start and end
2061+ periods : integer, default None
2062+ Number of dates to generate
20632063 freq : string or DateOffset, default 'B' (business daily)
2064- Frequency strings can have multiples, e.g. '5H'
2064+ Frequency strings can have multiples, e.g. '5, default
20652065 tz : string or None
20662066 Time zone name for returning localized DatetimeIndex, for example
20672067 Asia/Beijing
20682068 normalize : bool, default False
20692069 Normalize start/end dates to midnight before generating date range
2070- name : str , default None
2071- Name for the resulting index
2072- closed : string or None , default None
2070+ name : string , default None
2071+ Name of the resulting DatetimeIndex
2072+ closed : string, default None
20732073 Make the interval closed with respect to the given frequency to
20742074 the 'left', 'right', or both sides (None)
20752075
20762076 Notes
20772077 -----
2078- Of the three parameters, ``start``, ``end``, and ``periods``, exactly two
2078+ Of the three parameters: ``start``, ``end``, and ``periods``, exactly two
20792079 must be specified.
20802080
20812081 To learn more about the frequency strings, please see `this link
@@ -2094,7 +2094,7 @@ def bdate_range(start=None, end=None, periods=None, freq='B', tz=None,
20942094def cdate_range (start = None , end = None , periods = None , freq = 'C' , tz = None ,
20952095 normalize = True , name = None , closed = None , ** kwargs ):
20962096 """
2097- **EXPERIMENTAL** Return a fixed frequency datetime index , with
2097+ **EXPERIMENTAL** Return a fixed frequency DatetimeIndex , with
20982098 CustomBusinessDay as the default frequency
20992099
21002100 .. warning:: EXPERIMENTAL
@@ -2108,29 +2108,29 @@ def cdate_range(start=None, end=None, periods=None, freq='C', tz=None,
21082108 Left bound for generating dates
21092109 end : string or datetime-like, default None
21102110 Right bound for generating dates
2111- periods : integer or None , default None
2112- If None, must specify start and end
2111+ periods : integer, default None
2112+ Number of dates to generate
21132113 freq : string or DateOffset, default 'C' (CustomBusinessDay)
21142114 Frequency strings can have multiples, e.g. '5H'
2115- tz : string or None
2115+ tz : string, default None
21162116 Time zone name for returning localized DatetimeIndex, for example
21172117 Asia/Beijing
21182118 normalize : bool, default False
21192119 Normalize start/end dates to midnight before generating date range
2120- name : str , default None
2121- Name for the resulting index
2122- weekmask : str , Default 'Mon Tue Wed Thu Fri'
2120+ name : string , default None
2121+ Name of the resulting DatetimeIndex
2122+ weekmask : string , Default 'Mon Tue Wed Thu Fri'
21232123 weekmask of valid business days, passed to ``numpy.busdaycalendar``
21242124 holidays : list
21252125 list/array of dates to exclude from the set of valid business days,
21262126 passed to ``numpy.busdaycalendar``
2127- closed : string or None , default None
2127+ closed : string, default None
21282128 Make the interval closed with respect to the given frequency to
21292129 the 'left', 'right', or both sides (None)
21302130
21312131 Notes
21322132 -----
2133- Of the three parameters, ``start``, ``end``, and ``periods``, exactly two
2133+ Of the three parameters: ``start``, ``end``, and ``periods``, exactly two
21342134 must be specified.
21352135
21362136 To learn more about the frequency strings, please see `this link
0 commit comments