Skip to content
Advertisement

Python: How to filter a Pandas DataFrame using Values from a Series?

Context

I am currently processing some data and encountered a problem. I would like to filter a Pandas DataFrame using Values from a Series. However, this always throws the following Error:

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Code

JavaScript

Question

Does anyone have an idea what’s this error means and how I can solve it? Thanks a lot for your assistance in advance!

Advertisement

Answer

Problem is row['startTS'] < data['startTS'] < row['endTS'], you can use

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement