私は機械学習のためにGraphlabを使用する方法を学んでいます。だから、私は4つの列でこのデータセットを持っています - 列 '名前'と別の 'レビュー'があります。Python.ValueError:複数の要素を持つ配列の真理値はあいまいです。 a.any()またはa.all()を使用する
ここでは、特定の製品のレビューを製品名で入手したいと考えています。だから、これは私が試みたものですが、私はエラーを残しています - ValueError:複数の要素を持つ配列の真理値はあいまいです。 a.any()または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()
編集 -
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()
試みのようにそれを使用することができ
False
ではありません –@MohamedALANI: - ありがとう。まだ同じエラーが発生しています。 –
'products ['name']'を表示してください。 –