When using Logical Operators in Python, you must define the order of operations through parentheses when there is more than one operation involved. If you’re getting an error, it is probably because Python can’t figure out the order in which you want the operations performed. Additionally, depending on what you are trying to accomplish, you may need two logical operators in your statement.
For instance, try:
x=(A[0,0,:,:,:] > A[0,1,:,:,:]) & (A[0,0,:,:,:] > A[0,1,:,:,:].ge(0.5))