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
Comment From: changhiskhan
I don't think this was ever implemented. In sort_index
if by
is specified then axis must be 0
Comment From: jseabold
Just making sure I wasn't missing anything. I added the enhancement tag.
Comment From: changhiskhan
sweet thanks. Brian (Granger) was just talking about your election model notebook as I'm typing this comment
Comment From: jorisvandenbossche
new issue at #10806