ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
r is a numpy (rec)array. So r[“dt”] >= startdate is also a (boolean) array. For numpy arrays the & operation returns the elementwise-and of the two boolean arrays. The NumPy developers felt there was no one commonly understood way to evaluate an array in boolean context: it could mean True if any element is True, … Read more