x (> if bool else <) y
x (> if bool else <) y Question: I’m looking for a logic to use a function with different operators. Is there a way to implement the logic to use a boolean to determine the operator in the comparison? something along the lines of while df["column"][i + period] (> if bool_var else <=) min(df["column"]) Edit: …