The conditional expression https://github.com/hyperopt/hyperopt/blob/23a42a34052699bf7433f4a7c0a659cdab87ce54/hyperopt/base.py#L154 was (I presume) intended to catch boolean values, but when arg is e.g a pandas.Series, this test causes a ValueError because arg is implicitly converted to bool:
In [6]: s = pd.Series([0.1, 0.2])
In [7]: s in (True, False)
Traceback (most recent call last):
File "<ipython-input-7-9fa06f10f888>", line 1, in <module>
s in (True, False)
File "C:\Users\Roman\Anaconda3\lib\site-packages\pandas\core\generic.py", line 1576, in __nonzero__
.format(self.__class__.__name__))
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
I think that it would be better to replace elif arg in (True, False) with elif isinstance(arg, bool).
I don't think Hyperopt supports Pandas, you'll need to convert to either a List or Dictionary.
I understand, but the change I proposed would result in a correct error being generated. Currently it's a bit confusing.
@katastrofa999 indeed a catastrophe, mind sending a PR?
Done.