<p dir="auto">I have this data frame.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" 728  562  599  642  592  686  602  744  640  678"><pre class="notranslate"><code class="notranslate"> 728  562  599  642  592  686  602  744  640  678
</code></pre></div>
<p dir="auto">309   96   29   99   63   73   48   81   48   13   25<br>
337   40   25   41   47   14   33   54   63   33   45<br>
395   64   95   63   90   52   82   66   26   26   20<br>
264   38   56   73   17   98   56   80   77   44   49</p>
<p dir="auto">I want to sort it horizontally based on row index 264<br>
I tried:<br>
df.sort_values(by=264, axis=1)</p>
<p dir="auto">I gives me: ValueError: When sorting by column, axis must be 0 (rows)</p>
<p dir="auto">What is the usecase with axis=1</p>
<p dir="auto">xref <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="98622048" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/10726" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/10726/hovercard" href="https://github.com/pandas-dev/pandas/pull/10726">#10726</a></p>
<p dir="auto">This is possible, just not implemented</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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)"><pre class="notranslate"><code class="notranslate">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)
</code></pre></div>