In [1]:
import glob
In [2]:
glob.glob('*.csv')
Out[2]:
[]
In [3]:
!pwd
/home/swc/2015-06-02-data/python

In [4]:
glob.glob('data/*.csv')
Out[4]:
['data/inflammation-04.csv',
 'data/inflammation-10.csv',
 'data/inflammation-01.csv',
 'data/inflammation-08.csv',
 'data/small-03.csv',
 'data/small-02.csv',
 'data/inflammation-12.csv',
 'data/inflammation-09.csv',
 'data/inflammation-11.csv',
 'data/inflammation-07.csv',
 'data/inflammation-02.csv',
 'data/small-01.csv',
 'data/inflammation-03.csv',
 'data/inflammation-05.csv',
 'data/inflammation-06.csv']
In [23]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt

filenames = glob.glob('data/*.csv')
filenames = filenames[0:3]
for f in filenames:
    print f
    data = np.loadtxt(f, delimiter=',')
    fig = plt.figure(figsize=(10.0, 3.0))
    
    axes1 = fig.add_subplot(1, 3, 1)
    axes2 = fig.add_subplot(1, 3, 2)
    axes3 = fig.add_subplot(1, 3, 3)
    
    axes1.set_ylabel('average')
    axes1.plot( data.mean(axis=0) )
    
    axes2.set_ylabel(r'$\frac{max}{min}$')
    axes2.plot( data.max(axis=0) )
    
    axes3.set_ylabel('min')
    axes3.plot( data.min(axis=0) )
    
    fig.tight_layout()
    plt.show(fig)
data/inflammation-04.csv

data/inflammation-10.csv

data/inflammation-01.csv

Now with something different

In []: