I would like to compare numpy arrays of equal size in terms of greater/smaller relations. Specifically, I have
>>> import numpy as np
>>> A = np.array([0.5, 2., 0.1, 12.])
>>> B = np.ones(len(A))
>>> A<B
array([ True, False, True, False], dtype=bool)
>>> C = np.array([0.5, 2., 0.1, 12., 0.8])
>>> D = np.ones(len(C))
>>> C<D
array([ True, False, True, False, False], dtype=bool)
The last element is False although 0.8 is less than 1.0. This seems to happen for uneven array lengths. Am I missing something here?
I'm using Python 2.7.6 with NumPy 1.8.0.
However, it works with NumPy 1.8.2.