Skip to content

Commit 70c3dda

Browse files
committed
to_list as alias for tolist
1 parent 62a15fa commit 70c3dda

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

doc/source/whatsnew/v0.24.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,7 @@ Other API Changes
911911
- Slicing a single row of a DataFrame with multiple ExtensionArrays of the same type now preserves the dtype, rather than coercing to object (:issue:`22784`)
912912
- :class:`DateOffset` attribute `_cacheable` and method `_should_cache` have been removed (:issue:`23118`)
913913
- :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`).
914+
- ``Series.tolist()`` and ``Index.tolist()`` now have an alias ``to_list`` (:issue:`8826`)
914915

915916
.. _whatsnew_0240.deprecations:
916917

pandas/core/arrays/categorical.py

+2
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,8 @@ def tolist(self):
554554
"""
555555
return list(self)
556556

557+
to_list = tolist
558+
557559
@property
558560
def base(self):
559561
""" compat, we are always our own object """

pandas/core/base.py

+2
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,8 @@ def tolist(self):
888888
else:
889889
return self._values.tolist()
890890

891+
to_list = tolist
892+
891893
def __iter__(self):
892894
"""
893895
Return an iterator of the values.

0 commit comments

Comments
 (0)