另外条件筛选还可以集逻辑运算符 | for or, & for and, and ~for not
In [129]: s = pd.Series(range(-3, 4))
In [132]: s[(s < -1) | (s > 0.5)]
Out[132]:
0 -3
1 -2
4 1
5 2
6 3
dtype: int64
---------------------
另外条件筛选还可以集逻辑运算符 | for or, & for and, and ~for not
In [129]: s = pd.Series(range(-3, 4))
In [132]: s[(s < -1) | (s > 0.5)]
Out[132]:
0 -3
1 -2
4 1
5 2
6 3
dtype: int64
---------------------