Issue
I recently wrote a python script for someone, where I converted a pandas dataframe's index into a list using to_list()
. However, this does not work for them, as they get: AttributeError: 'Index' object has no attribute 'to_list'
with their python interpretter.
I did some searching and found that there is also tolist()
that seems to do the same as to_list()
: searching on Pandas documentation finds both, with word-for-word identical description.
On the other hand, the documentation of Index mentions only to_list()
.
So I wonder whether there is a difference between the two
- in functionality
- in popularity and/or "officiality"/endorsement
- in support in different version of pandas
Solution
If you check the source code, you will see that right after tolist()
code there is line to_list = tolist
, so to_list
is just alias for tolist
EDIT: to_list()
was added in ver. 0.24.0, see issue#8826
Answered By - buran
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.