Skip to content

Implement DataFrame.sort for axis=1 #2940

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
jseabold opened this issue Feb 27, 2013 · 4 comments
Closed

Implement DataFrame.sort for axis=1 #2940

jseabold opened this issue Feb 27, 2013 · 4 comments
Labels
Duplicate Report Duplicate issue or pull request Enhancement

Comments

@jseabold
Copy link
Contributor

Am I missing something here?

import numpy as np
import pandas

x = np.array([[0,2,4],[2,0,7],[4,7,0]])
df = pandas.DataFrame(x, index=["a","b", "c"], columns=["a","b","c"])
df.sort("b", inplace=True)
#raises error for axis=1
#df.sort("c", axis=1, inplace=True)
# same with sort_index

# desired result
df.sort("b").T.sort("c").T
@changhiskhan
Copy link
Contributor

I don't think this was ever implemented. In sort_index if by is specified then axis must be 0

@jseabold
Copy link
Contributor Author

Just making sure I wasn't missing anything. I added the enhancement tag.

@changhiskhan
Copy link
Contributor

sweet thanks. Brian (Granger) was just talking about your election model notebook as I'm typing this comment

@jorisvandenbossche jorisvandenbossche modified the milestones: No action, Someday Aug 12, 2015
@jorisvandenbossche
Copy link
Member

new issue at #10806

@jorisvandenbossche jorisvandenbossche added the Duplicate Report Duplicate issue or pull request label Aug 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants