Hi,
I have two arrays that are identical and contain 1s and zeros. Only the
ones are valid and I need to know where both arrays have ones in the
same position. I thought logical_and would work but this example proves
otherwise:[color=blue][color=green][color=darkred]
>>> a = [0,1,2,5,6,6]
>>> b = [5,4,1,6,4,6]
>>> Numeric.logical _and(a==6,b==6)[/color][/color][/color]
0[color=blue][color=green][color=darkred]
>>> Numeric.where(a ==b,1,0)[/color][/color][/color]
0[color=blue][color=green][color=darkred]
>>> Numeric.where(a ==6 and b==6,1,0)[/color][/color][/color]
0
The where() statement is also worhtless here. Does anyone have any
suggestion on how to do this?
Thanks in advance,
Sheldon
I have two arrays that are identical and contain 1s and zeros. Only the
ones are valid and I need to know where both arrays have ones in the
same position. I thought logical_and would work but this example proves
otherwise:[color=blue][color=green][color=darkred]
>>> a = [0,1,2,5,6,6]
>>> b = [5,4,1,6,4,6]
>>> Numeric.logical _and(a==6,b==6)[/color][/color][/color]
0[color=blue][color=green][color=darkred]
>>> Numeric.where(a ==b,1,0)[/color][/color][/color]
0[color=blue][color=green][color=darkred]
>>> Numeric.where(a ==6 and b==6,1,0)[/color][/color][/color]
0
The where() statement is also worhtless here. Does anyone have any
suggestion on how to do this?
Thanks in advance,
Sheldon
Comment