@@ -292,8 +292,8 @@ def __new__(cls, data=None,
292
292
if is_float (periods ):
293
293
periods = int (periods )
294
294
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 ))
297
297
298
298
if data is None and freq is None :
299
299
raise ValueError ("Must provide freq argument if no data is "
@@ -412,7 +412,7 @@ def __new__(cls, data=None,
412
412
def _generate (cls , start , end , periods , name , offset ,
413
413
tz = None , normalize = False , ambiguous = 'raise' , closed = None ):
414
414
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 '
416
416
'periods, exactly two must be specified' )
417
417
418
418
_normalized = True
@@ -2005,7 +2005,7 @@ def _generate_regular_range(start, end, periods, offset):
2005
2005
def date_range (start = None , end = None , periods = None , freq = 'D' , tz = None ,
2006
2006
normalize = False , name = None , closed = None , ** kwargs ):
2007
2007
"""
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
2009
2009
frequency
2010
2010
2011
2011
Parameters
@@ -2014,24 +2014,24 @@ def date_range(start=None, end=None, periods=None, freq='D', tz=None,
2014
2014
Left bound for generating dates
2015
2015
end : string or datetime-like, default None
2016
2016
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
2019
2019
freq : string or DateOffset, default 'D' (calendar daily)
2020
2020
Frequency strings can have multiples, e.g. '5H'
2021
- tz : string or None
2021
+ tz : string, default None
2022
2022
Time zone name for returning localized DatetimeIndex, for example
2023
2023
Asia/Hong_Kong
2024
2024
normalize : bool, default False
2025
2025
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
2029
2029
Make the interval closed with respect to the given frequency to
2030
2030
the 'left', 'right', or both sides (None)
2031
2031
2032
2032
Notes
2033
2033
-----
2034
- Of the three parameters, ``start``, ``end``, and ``periods``, exactly two
2034
+ Of the three parameters: ``start``, ``end``, and ``periods``, exactly two
2035
2035
must be specified.
2036
2036
2037
2037
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,
2049
2049
def bdate_range (start = None , end = None , periods = None , freq = 'B' , tz = None ,
2050
2050
normalize = True , name = None , closed = None , ** kwargs ):
2051
2051
"""
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
2053
2053
frequency
2054
2054
2055
2055
Parameters
@@ -2058,24 +2058,24 @@ def bdate_range(start=None, end=None, periods=None, freq='B', tz=None,
2058
2058
Left bound for generating dates
2059
2059
end : string or datetime-like, default None
2060
2060
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
2063
2063
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
2065
2065
tz : string or None
2066
2066
Time zone name for returning localized DatetimeIndex, for example
2067
2067
Asia/Beijing
2068
2068
normalize : bool, default False
2069
2069
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
2073
2073
Make the interval closed with respect to the given frequency to
2074
2074
the 'left', 'right', or both sides (None)
2075
2075
2076
2076
Notes
2077
2077
-----
2078
- Of the three parameters, ``start``, ``end``, and ``periods``, exactly two
2078
+ Of the three parameters: ``start``, ``end``, and ``periods``, exactly two
2079
2079
must be specified.
2080
2080
2081
2081
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,
2094
2094
def cdate_range (start = None , end = None , periods = None , freq = 'C' , tz = None ,
2095
2095
normalize = True , name = None , closed = None , ** kwargs ):
2096
2096
"""
2097
- **EXPERIMENTAL** Return a fixed frequency datetime index , with
2097
+ **EXPERIMENTAL** Return a fixed frequency DatetimeIndex , with
2098
2098
CustomBusinessDay as the default frequency
2099
2099
2100
2100
.. warning:: EXPERIMENTAL
@@ -2108,29 +2108,29 @@ def cdate_range(start=None, end=None, periods=None, freq='C', tz=None,
2108
2108
Left bound for generating dates
2109
2109
end : string or datetime-like, default None
2110
2110
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
2113
2113
freq : string or DateOffset, default 'C' (CustomBusinessDay)
2114
2114
Frequency strings can have multiples, e.g. '5H'
2115
- tz : string or None
2115
+ tz : string, default None
2116
2116
Time zone name for returning localized DatetimeIndex, for example
2117
2117
Asia/Beijing
2118
2118
normalize : bool, default False
2119
2119
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'
2123
2123
weekmask of valid business days, passed to ``numpy.busdaycalendar``
2124
2124
holidays : list
2125
2125
list/array of dates to exclude from the set of valid business days,
2126
2126
passed to ``numpy.busdaycalendar``
2127
- closed : string or None , default None
2127
+ closed : string, default None
2128
2128
Make the interval closed with respect to the given frequency to
2129
2129
the 'left', 'right', or both sides (None)
2130
2130
2131
2131
Notes
2132
2132
-----
2133
- Of the three parameters, ``start``, ``end``, and ``periods``, exactly two
2133
+ Of the three parameters: ``start``, ``end``, and ``periods``, exactly two
2134
2134
must be specified.
2135
2135
2136
2136
To learn more about the frequency strings, please see `this link
0 commit comments