In [1]:
%pylab inline
import pandas as pd


Populating the interactive namespace from numpy and matplotlib

In [2]:
%ls


001_EDSS_wheel_2CUESonSIDESmoveCORRtoMIDDLE_v27_INS_stage3_latest-19.11.14.csv
Fourier.ipynb
Migration velocity.ipynb
Read_csv.ipynb
nerst.py
plot_relation_motifs.py
stats.txt
test.xls

In [3]:
fname = '001_EDSS_wheel_2CUESonSIDESmoveCORRtoMIDDLE_v27_INS_stage3_latest-19.11.14.csv'
mylist = list()
with open(fname, 'r', newline='', encoding="utf16") as fp:
    for line in fp:
        if 'rewPERIODstart' in line:
            line = line.rstrip() # remove \r and \n
            mydata = line.split(";")
            mylist.append(mydata[-4:]) # last four elements

In [4]:
# convert to NumPy
x = np.array(mylist, dtype=int).T
x.shape


Out[4]:
(4, 238)

In [5]:
x[0]


Out[5]:
array([ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 14, 13, 13, 13,
       12, 11, 11, 10, 11, 11, 12, 11, 11, 11, 12, 13, 13, 14, 14, 15, 16,
       16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 15, 15, 16,
       17, 18, 18, 17, 17, 16, 17, 16, 16, 16, 16, 16, 16, 15, 14, 15, 15,
       14, 14, 14, 15, 14, 13, 14, 13, 12, 12, 11, 11, 12, 12, 12, 11, 11,
       11, 11, 11, 10,  9,  9,  9,  9,  9,  9, 10, 11, 11, 11, 12, 12, 13,
       14, 13, 13, 13, 13, 13, 14, 15, 15, 14, 14, 14, 15, 16, 16, 16, 15,
       15, 16, 15, 14, 14, 15, 15, 14, 13, 12, 12, 12, 12, 12, 13, 13, 13,
       14, 15, 14, 14, 14, 14, 14, 15, 16, 16, 16, 17, 18, 17, 16, 15, 15,
       15, 16, 17, 17, 17, 16, 16, 16, 16, 16, 16, 17, 17, 16, 16, 17, 16,
       15, 15, 14, 13, 12, 13, 14, 15, 16, 16, 16, 16, 17, 17, 17, 16, 15,
       15, 14, 13, 13, 14, 15, 15, 14, 15, 16, 15, 16, 17, 17, 16, 16, 15,
       14, 15, 15, 15, 14, 13, 13, 13, 13, 13, 14, 15, 14, 14, 13, 13, 14])

In [6]:
plt.figure(figsize = (16,5))
plt.plot(x[0])
plt.plot(x[1])
plt.plot(x[2])
plt.plot(x[3])
plt.yticks(range(0,40,10));



In [ ]: