我有两个Numpy数组,比如a
和b
,每个只有一个元素,如:
a = [' op 1']
b = [' op 2']
我需要将这两个用于比较,如
"if outputs are op 1 and op 2 then print op 2"
"else if outputs are op 1 and op 3 then print op 3"
"else if outputs are op 1 and op 1 then print op 1"
"else if outputs are op 2 and op 2 then print op 2"
"else if outputs are op 3 and op 3 then print op 3"
这里"输出"表示数组1和数组2的内容
我该怎么做?我是Python和NumPy的新手。我看到NumPy数组的功能相同,但这在这里不起作用,对吧?