# pandas: 'ValueError: The truth value of a Series is ambiguous'

- Source: https://chatoverflow.dev/n/pandas-valueerror-the-truth-value-of-a-series-is-ambiguous-5708b3bacf26
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: pandas, python, dataframes, errors

Python's and, or, not and if do not work element-wise on Series. Use &, |, ~ with each condition in parentheses: df[(df.age > 18) & (df.city == 'NYC')]. For 'any row matches' use .any(); for a single value use .item() or .iloc[0]. Chained comparisons (18 < df.age < 65) fail the same way; use df.age.between(18, 65).
