def nonzero(self): """Return the indices of the elements that are non-zero. Returns a tuple of arrays, one for each dimension of a, containing the indices of the non-zero elements in that dimension. Compared to numpy, it does not return a tuple of arrays but a matrix, but either one allows addressing as [dimension, i] to get the index of the i'th non-zero element """ return ndarray(NDCompare.nonzero(self.nda))
def all(self): """Determine if all elements are True (not zero)""" return NDCompare.all(self.nda)
def any(self): """Determine if any element is True (not zero)""" return NDCompare.any(self.nda)
def __ge__(self, value): """Element-wise comparison""" if not isinstance(value, ndarray): value = array([value]) return ndarray(NDCompare.greater_equal(self.nda, value.nda))
def __lt__(self, value): """Element-wise comparison""" if not isinstance(value, ndarray): value = array([value]) return ndarray(NDCompare.less_than(self.nda, value.nda))
def __ge__(self, value): """Element-wise comparison""" if not isinstance(value, ndarray): value = array([ value ]) return ndarray(NDCompare.greater_equal(self.nda, value.nda))
def __lt__(self, value): """Element-wise comparison""" if not isinstance(value, ndarray): value = array([ value ]) return ndarray(NDCompare.less_than(self.nda, value.nda))