Skip to content

Commit b15bfe9

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

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
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')

doc/source/whatsnew/v0.24.0.rst

-1
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,6 @@ Other API Changes
10711071
- :meth:`Index.hasnans` and :meth:`Series.hasnans` now always return a python boolean. Previously, a python or a numpy boolean could be returned, depending on circumstances (:issue:`23294`).
10721072
- The order of the arguments of :func:`DataFrame.to_html` and :func:`DataFrame.to_string` is rearranged to be consistent with each other. (:issue:`23614`)
10731073
- :meth:`CategoricalIndex.reindex` now raises a ``ValueError`` if the target index is non-unique and not equal to the current index. It previously only raised if the target index was not of a categorical dtype (:issue:`23963`).
1074-
- ``Series.tolist()`` and ``Index.tolist()`` now have an alias ``to_list`` (:issue:`8826`)
10751074
- :func:`Series.tolist` and :func:`Index.tolist()` now have an alias ``to_list`` (:issue:`8826`)
10761075

10771076
.. _whatsnew_0240.deprecations:

0 commit comments

Comments
 (0)