3 ms·
To help readability I tend to do something like this: f1 = (df["col1"] == condition1) f2 = (df["col2"] == condition2) df[f1 & f2] This is equivalent to the
by RobinL 7y ago
To help readability I tend to do something like this:
f1 = (df["col1"] == condition1)
f2 = (df["col2"] == condition2)
df[f1 & f2]
This is equivalent to the 'pandas boolean indexing multiple conditions' method.
- abricot 7y agoI do the same without the parenthesis.