Pandasでのブールインデックスの論理演算子
Pandasでブールインデックスを使用しています。問題は、ステートメントがなぜであるかです: a[(a['some_column']==some_number) & (a['some_other_column']==some_other_number)] 正常に動作しますが a[(a['some_column']==some_number) and (a['some_other_column']==some_other_number)] エラーで終了しますか? 例: a=pd.DataFrame({'x':[1,1],'y':[10,20]}) In: a[(a['x']==1)&(a['y']==10)] Out: x y 0 1 10 In: a[(a['x']==1) and (a['y']==10)] Out: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()