Skip to content

Clarify docstring: Series.sort_index() creates new instance (rather than sorting in-place) #10721

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

Conversation

maxalbert
Copy link
Contributor

No description provided.

@jreback
Copy link
Contributor

jreback commented Aug 1, 2015

all pandas objects return new objects except for indexing operators. the fact that Series.sort is actually in place is a historical fact and will be deprecated (in favor of a new method .sorted soon)

so this is superfluous

@jreback jreback closed this Aug 1, 2015
@maxalbert
Copy link
Contributor Author

Thanks for the clarification (and the super-quick response!), and apologies for the noise. I just saw that this is indeed mentioned in the docs (for reference: http://pandas.pydata.org/pandas-docs/stable/basics.html#copying). It's good to know that Series.sort() will be deprecated soon. I think it is the fact that this method does an in-place modification (but most/all others don't) which has led to quite a bit of confusion amongst some colleagues of mine. Glad to hear that it will be consistent soon.

@maxalbert maxalbert deleted the clarify_docstring_for_series_sort_index branch August 1, 2015 21:12
@jreback
Copy link
Contributor

jreback commented Aug 1, 2015

this has been a wart for a while and I am going to fix it soon
it comes from the fact that np.sort is in place (for efficiency but odd for semantics)

@jreback jreback mentioned this pull request Aug 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants