Match any value in a list
.isin([...]) checks whether each value belongs to a list. Use ~ before the condition to exclude those values.
| index | team | score |
|---|---|---|
| 0 | A | 10 |
| 1 | B | 20 |
| 2 | C | 30 |
| index | team | score |
|---|---|---|
| 0 | A | 10 |
| 2 | C | 30 |
Match several values with isin and control numeric range boundaries with between.
Step 1 of 3 · Learn
.isin([...]) checks whether each value belongs to a list. Use ~ before the condition to exclude those values.
| index | team | score |
|---|---|---|
| 0 | A | 10 |
| 1 | B | 20 |
| 2 | C | 30 |
| index | team | score |
|---|---|---|
| 0 | A | 10 |
| 2 | C | 30 |
.between(low, high, inclusive="both") includes both endpoints. Use "neither" to exclude both, "left" to include only the lower endpoint, or "right" to include only the upper endpoint.
| index | score |
|---|---|
| 0 | 10 |
| 1 | 20 |
| 2 | 30 |
| 3 | 40 |
| index | score |
|---|---|
| 1 | 20 |
| 2 | 30 |
Return search_id and device for searches on desktop or tablet. Keep source row order and save the DataFrame as result.
Loading Python and Pandas…
Run the code to see DataFrame results here.