@@ -1084,7 +1084,7 @@ in the usual way.
10841084 dt + bmth_us
10851085
10861086 # Define date index with custom offset
1087- pd.DatetimeIndex (start = ' 20100101' , end = ' 20120101' , freq = bmth_us)
1087+ pd.date_range (start = ' 20100101' , end = ' 20120101' , freq = bmth_us)
10881088
10891089 .. note ::
10901090
@@ -1438,8 +1438,8 @@ or ``Timestamp`` objects.
14381438
14391439.. ipython :: python
14401440
1441- pd.DatetimeIndex (start = ' 7/1/2012' , end = ' 7/10/2012' ,
1442- freq = pd.offsets.CDay(calendar = cal)).to_pydatetime()
1441+ pd.date_range (start = ' 7/1/2012' , end = ' 7/10/2012' ,
1442+ freq = pd.offsets.CDay(calendar = cal)).to_pydatetime()
14431443 offset = pd.offsets.CustomBusinessDay(calendar = cal)
14441444 datetime.datetime(2012 , 5 , 25 ) + offset
14451445 datetime.datetime(2012 , 7 , 3 ) + offset
@@ -2300,8 +2300,8 @@ To remove timezone from tz-aware ``DatetimeIndex``, use ``tz_localize(None)`` or
23002300
23012301.. ipython :: python
23022302
2303- didx = pd.DatetimeIndex (start = ' 2014-08-01 09:00' , freq = ' H' ,
2304- periods = 10 , tz = ' US/Eastern' )
2303+ didx = pd.date_range (start = ' 2014-08-01 09:00' , freq = ' H' ,
2304+ periods = 10 , tz = ' US/Eastern' )
23052305 didx
23062306 didx.tz_localize(None )
23072307 didx.tz_convert(None )
@@ -2354,8 +2354,8 @@ constructor as well as ``tz_localize``.
23542354 rng_hourly.tz_localize(' US/Eastern' , ambiguous = rng_hourly_dst).to_list()
23552355 rng_hourly.tz_localize(' US/Eastern' , ambiguous = ' NaT' ).to_list()
23562356
2357- didx = pd.DatetimeIndex (start = ' 2014-08-01 09:00' , freq = ' H' ,
2358- periods = 10 , tz = ' US/Eastern' )
2357+ didx = pd.date_range (start = ' 2014-08-01 09:00' , freq = ' H' ,
2358+ periods = 10 , tz = ' US/Eastern' )
23592359 didx
23602360 didx.tz_localize(None )
23612361 didx.tz_convert(None )
0 commit comments