Error in while executing pandas for indexing

df[(df[‘method’] == ‘Radial Velocity’) or (df[‘year’]==2010)]

giving this error dont know why

ValueError Traceback (most recent call last) <ipython-input-23-57a95dfd0a5d> in <module>() ----> 1 df[((df[‘method’] == ‘Radial Velocity’) or (df[‘year’]==2010)).any()] /usr/local/lib/python3.7/dist-packages/pandas/core/ in __nonzero__(self) ** 1328** def __nonzero__(self): ** 1329** raise ValueError( -> 1330 f"The truth value of a {type(self).__name__} is ambiguous. " ** 1331** “Use a.empty, a.bool(), a.item(), a.any() or a.all().” ** 1332** ) ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

You need to use the symbols and not the operator name while filtering data in Pandas:

df[(df['method'] == 'Radial Velocity') | (df['year']==2010)]

If you want to use operators by their name, then consider using .query() function