Relational and Logical Operators with Pandas Series
Let's find out how to use relational operators to compare the values of a pandas series.
We'll cover the following...
We'll cover the following...
Try it yourself
Try executing the code below to see the result.
Explanation
The result of nums > 2 is the series of Boolean values listed below:
In [1]: nums>2
Out[1]:
0 False
1 False
2 True
3 True
4 True
5 True
dtype: bool
We can use this Boolean series to select parts ...