1 for row in ro.where('pressure > 10'):
2 print row['energy']
1 >>> x = range(10000)
2 >>> %timeit [item + 1 for item in x]
3 1000 loops, best of 3: 437 us per loop
1 >>> x = numpy.arange(10000)
2 >>> %timeit x + 1
3 100000 loops, best of 3: 13.9 us per loop
1 >>> x = numpy.arange(3)
2 >>> x
3 array([0, 1, 2])
4 >>> x[x > 1]
5 array([2])
6 >>> x > 1
7 array([False, False, True], dtype=bool)
1 >>> x
2 array([0, 1, 2])
3 >>> x[:2][0] = 1
4 >>> x
5 array([1, 1, 2])
6 >>> x[x > 0][0] = 10
7 >>> x
8 array([1, 1, 2])
1 >>> rand_arr = np.random.rand(2, 2)
2 >>> numpy.savetxt('test.out',
3 rand_arr,
4 delimiter=' ',
5 fmt='%1.5f',
6 header='a b',
7 comments='')
1 >>> pandas.read_csv('test.out',
2 delim_whitespace=True)
3 a b
4 0 0.93954 0.74496
5 1 0.12518 0.17269
1 >>> from scipy import integrate
2 >>> x2 = lambda x: x**2
3 >>> integrate.quad(x2,0.,4.)
4 (21.333333333333332, 2.3684757858670003e-13)