Skip to content

Commit 5d58584

Browse files
committed
Updated tolist to to_list in doc examples
1 parent e6a90a2 commit 5d58584

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

doc/source/timedeltas.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -436,11 +436,11 @@ Finally, the combination of ``TimedeltaIndex`` with ``DatetimeIndex`` allow cert
436436
.. ipython:: python
437437
438438
tdi = pd.TimedeltaIndex(['1 days', pd.NaT, '2 days'])
439-
tdi.tolist()
439+
tdi.to_list()
440440
dti = pd.date_range('20130101', periods=3)
441-
dti.tolist()
442-
(dti + tdi).tolist()
443-
(dti - tdi).tolist()
441+
dti.to_list()
442+
(dti + tdi).to_list()
443+
(dti - tdi).to_list()
444444
445445
Conversions
446446
~~~~~~~~~~~
@@ -461,7 +461,7 @@ Scalars type ops work as well. These can potentially return a *different* type o
461461
462462
# subtraction of a date and a timedelta -> datelike
463463
# note that trying to subtract a date from a Timedelta will raise an exception
464-
(pd.Timestamp('20130101') - tdi).tolist()
464+
(pd.Timestamp('20130101') - tdi).to_list()
465465
466466
# timedelta + timedelta -> timedelta
467467
tdi + pd.Timedelta('10 days')

doc/source/timeseries.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -2338,7 +2338,7 @@ Infer the ambiguous times
23382338
.. ipython:: python
23392339
23402340
rng_hourly_eastern = rng_hourly.tz_localize('US/Eastern', ambiguous='infer')
2341-
rng_hourly_eastern.tolist()
2341+
rng_hourly_eastern.to_list()
23422342
23432343
In addition to 'infer', there are several other arguments supported. Passing
23442344
an array-like of bools or 0s/1s where True represents a DST hour and False a
@@ -2351,8 +2351,8 @@ constructor as well as ``tz_localize``.
23512351
.. ipython:: python
23522352
23532353
rng_hourly_dst = np.array([1, 1, 0, 0, 0])
2354-
rng_hourly.tz_localize('US/Eastern', ambiguous=rng_hourly_dst).tolist()
2355-
rng_hourly.tz_localize('US/Eastern', ambiguous='NaT').tolist()
2354+
rng_hourly.tz_localize('US/Eastern', ambiguous=rng_hourly_dst).to_list()
2355+
rng_hourly.tz_localize('US/Eastern', ambiguous='NaT').to_list()
23562356
23572357
didx = pd.DatetimeIndex(start='2014-08-01 09:00', freq='H',
23582358
periods=10, tz='US/Eastern')

0 commit comments

Comments
 (0)