pandas plugin for python in a canopy environment not sorting?
<p>I've been working on this for a few hours and am giving up at this point. I have a scientific tool that is slightly glitching and creating a .csv database with datapoints out of order, i.e.</p>

<pre><code>Test_ID Data_Point  Test_Time   Step_Time etc...

1   1439    1441.044976 1328.572329
1   1440    1442.046983 1329.574335
1   1121    1122.423305 1009.950658
1   1122    1123.424295 1010.951648
</code></pre>

<p>Note how the data skips from 1440 back to 1121. if you backed tracked in the .csv file you'd find a section of about 40 rows, after 1120, missing.  This is a large data file of about 125k rows. </p>

<p>I'm using python in the canopy environment with pandas installed. I'm trying to sort the database on the Data_Point (as I thought it'd be the easiest, you could do it based on test or step time) column keeping the rows intact. Here is the code I've tried:</p>

<pre><code>import pandas as pd
import numpy
from pylab import plt, plot, legend, show

df = pd.read_csv("C:\ArbinData\PanCell3_Cycling_0-30.csv")
df2 = df.sort_values('Data_Point',  ascending = 0)

for x in range(1, len(df2['Data_Point']):
    #Do science. 
</code></pre>

<p>Thanks for any help, I'm out of energy on this one. </p>