Skip to content

Commit 392c4c2

Browse files
committed
to_list as alias for tolist
1 parent 5389987 commit 392c4c2

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

doc/source/whatsnew/v0.24.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,7 @@ 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`)
10741075

10751076
.. _whatsnew_0240.deprecations:
10761077

pandas/core/arrays/categorical.py

+2
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,8 @@ def tolist(self):
567567
"""
568568
return list(self)
569569

570+
to_list = tolist
571+
570572
@property
571573
def base(self):
572574
"""

pandas/core/base.py

+2
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,8 @@ def tolist(self):
10251025
else:
10261026
return self._values.tolist()
10271027

1028+
to_list = tolist
1029+
10281030
def __iter__(self):
10291031
"""
10301032
Return an iterator of the values.

0 commit comments

Comments
 (0)