In [22]:
import pandas as pd
import numpy as np
%matplotlib inline

In [23]:
a = np.arange(10)
d = {'t1':a,'t2':-a}
df = pd.DataFrame(d)

In [26]:
df.plot()


Out[26]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fdebbbc1050>

In [25]:
df


Out[25]:
t1 t2
0 0 0
1 1 -1
2 2 -2
3 3 -3
4 4 -4
5 5 -5
6 6 -6
7 7 -7
8 8 -8
9 9 -9

In [27]:
# find rows in table where:   1 < t1 <5 &  -6 < t2 < -2
a=np.logical_and(df['t1']>1,df['t1']<5)
b=np.logical_and(df['t2']>-6,df['t2']<-2)
criteria_satisfied = np.logical_and(a,b)

In [28]:
criteria_satisfied


Out[28]:
0    False
1    False
2    False
3     True
4     True
5    False
6    False
7    False
8    False
9    False
Name: t1, dtype: bool

In [29]:
criteria_satisfied.sum()


Out[29]:
2

In [ ]: