I am learning how to use Graphlab for machine learning. So, I have this dataset with four columns - There is a column 'name' and another 'review'.
Now, I want to get the review of specific product by the name of the product. So, this is what I tried but I keep the error - ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all().
if (products['name'] == "Vulli Sophie the Giraffe Teether"):
print (products['review'])
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-15-8607777f5c3b> in <module>()
----> 1 if (products['name'] == "Vulli Sophie the Giraffe Teether"):
2 print products['review']
C:\Users\user\Anaconda2\envs\gl-env\lib\site-packages\graphlab\data_structures\sarray.pyc in __nonzero__(self)
752 """
753 # message copied from Numpy
--> 754 raise ValueError("The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()")
755
756 def __bool__(self):
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Edit -
if (products['name'] == "Vulli Sophie the Giraffe Teether"):
print products['name']
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-16-1be157eebb1a> in <module>()
----> 1 if (products['name'] == "Vulli Sophie the Giraffe Teether"):
2 print products['name']
C:\Users\user\Anaconda2\envs\gl-env\lib\site-packages\graphlab\data_structures\sarray.pyc in __nonzero__(self)
752 """
753 # message copied from Numpy
--> 754 raise ValueError("The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()")
755
756 def __bool__(self):
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()