Skip to content

ENH: Add Series.to_list, alias for tolist #8826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
s-celles opened this issue Nov 15, 2014 · 2 comments · Fixed by #23398
Closed

ENH: Add Series.to_list, alias for tolist #8826

s-celles opened this issue Nov 15, 2014 · 2 comments · Fixed by #23398
Labels
API Design Compat pandas objects compatability with Numpy or Python functions good first issue
Milestone

Comments

@s-celles
Copy link
Contributor

Hello,

IPython autocomplete (tab) shows

In [1]: ts.to
ts.to_clipboard  ts.to_frame      ts.to_period     ts.to_string
ts.to_csv        ts.to_hdf        ts.to_pickle     ts.to_timestamp
ts.to_dense      ts.to_json       ts.to_sparse     ts.tolist
ts.to_dict       ts.to_msgpack    ts.to_sql

maybe tolist should be named to_list
and tolist should be marked as deprecated
because it seems that other methods follow
an implicit naming convention (to_...) .

Kind regards

@jreback jreback added API Design Compat pandas objects compatability with Numpy or Python functions labels Nov 15, 2014
@jreback jreback added this to the 0.16.0 milestone Nov 15, 2014
@jreback
Copy link
Contributor

jreback commented Nov 15, 2014

this is for compat with numpy, e.g. numpy.tolist is the standard method.

So, could add to_list to call tolist but can't change it.

But it would make things a bit more consistent. needs to be added in pandas/core/base/IndexOpsMixin (so both series/index getit)

pull-requests welcome!

@jorisvandenbossche
Copy link
Member

+1 for adding a to_list alias (but indeed not deprecating tolist)

@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 6, 2015
@wesm wesm changed the title Pandas Series tolist method should be named to_list ENH: Add Series.to_list, alias for tolist Jul 6, 2018
@jreback jreback modified the milestones: Contributions Welcome, 0.24.0 Nov 1, 2018
@jreback jreback modified the milestones: 0.24.0, Contributions Welcome Dec 2, 2018
@jreback jreback modified the milestones: Contributions Welcome, 0.24.0 Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Compat pandas objects compatability with Numpy or Python functions good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants