Skip to content

BUG/ENH: sort_values(by=index_label, axis=1) #10806

Closed
@jreback

Description

@jreback

xref #10726

This is possible, just not implemented

In [3]: df  = DataFrame(np.arange(16).reshape(4, 4), index=[1, 2, 3, 4], columns=['A', 'B', 'C', 'D'])

In [4]: df
Out[4]: 
    A   B   C   D
1   0   1   2   3
2   4   5   6   7
3   8   9  10  11
4  12  13  14  15

In [5]: df.sort_values(by=1,axis=1)
ValueError: When sorting by column, axis must be 0 (rows)

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementReshapingConcat, Merge/Join, Stack/Unstack, Explode

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions