Python - sort dataframe on two columns not working
<p>I have a problem when sorting data based on two columns!</p>

<p>In general I would like to set a timezone on a dataframe with a time change. Unfortunately     </p>

<pre><code>tz.localize("Europe/Berlin", infer_dst=True) 
</code></pre>

<p>throws an error as the data are not properly sorted (at least I think that is the reason..)</p>

<p>So I tried the sort the following dataframe:</p>

<pre><code>index                value   test1                 test2
2015-10-25 02:00:00   10     2015-10-25 02:00:00   0
2015-10-25 02:00:00   20     2015-10-25 02:00:00   1
2015-10-25 02:15:00   30     2015-10-25 02:15:00   0
2015-10-25 02:15:00   40     2015-10-25 02:15:00   1
2015-10-25 02:30:00   60     2015-10-25 02:30:00   0
2015-10-25 02:30:00   70     2015-10-25 02:30:00   1
2015-10-25 02:45:00   80     2015-10-25 02:45:00   0
2015-10-25 02:45:00   90     2015-10-25 02:45:00   1
</code></pre>

<p>to get the following output</p>

<pre><code>index                value   test1                 test2
2015-10-25 01:45:00   5     2015-10-25 01:45:00   0
2015-10-25 02:00:00   10     2015-10-25 02:00:00   0
2015-10-25 02:15:00   30     2015-10-25 02:15:00   0    
2015-10-25 02:30:00   60     2015-10-25 02:30:00   0
2015-10-25 02:45:00   80     2015-10-25 02:45:00   0
2015-10-25 02:00:00   20     2015-10-25 02:00:00   1
2015-10-25 02:15:00   40     2015-10-25 02:15:00   1
2015-10-25 02:30:00   70     2015-10-25 02:30:00   1
2015-10-25 02:45:00   90     2015-10-25 02:45:00   1
2015-10-25 03:00:00   90     2015-10-25 03:00:00   1
</code></pre>

<p>I tried:</p>

<pre><code>df.sort(["test1","test2"],ascending=[1, 1])
</code></pre>

<p>however, for some reason the order does not change. Any ideas?</p>

<p>Hi, I extended the desired output</p>