コード例 #1
0
 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))
コード例 #2
0
ファイル: ndarray.py プロジェクト: ATNF/cs-studio
 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))
コード例 #3
0
 def all(self):
     """Determine if all elements are True (not zero)"""
     return NDCompare.all(self.nda)
コード例 #4
0
 def any(self):
     """Determine if any element is True (not zero)"""
     return NDCompare.any(self.nda)
コード例 #5
0
 def __ge__(self, value):
     """Element-wise comparison"""
     if not isinstance(value, ndarray):
         value = array([value])
     return ndarray(NDCompare.greater_equal(self.nda, value.nda))
コード例 #6
0
 def __lt__(self, value):
     """Element-wise comparison"""
     if not isinstance(value, ndarray):
         value = array([value])
     return ndarray(NDCompare.less_than(self.nda, value.nda))
コード例 #7
0
ファイル: ndarray.py プロジェクト: ATNF/cs-studio
 def all(self):
     """Determine if all elements are True (not zero)"""
     return NDCompare.all(self.nda)
コード例 #8
0
ファイル: ndarray.py プロジェクト: ATNF/cs-studio
 def any(self):
     """Determine if any element is True (not zero)"""
     return NDCompare.any(self.nda)
コード例 #9
0
ファイル: ndarray.py プロジェクト: ATNF/cs-studio
 def __ge__(self, value):
     """Element-wise comparison"""
     if not isinstance(value, ndarray):
         value = array([ value ])
     return ndarray(NDCompare.greater_equal(self.nda, value.nda))
コード例 #10
0
ファイル: ndarray.py プロジェクト: ATNF/cs-studio
 def __lt__(self, value):
     """Element-wise comparison"""
     if not isinstance(value, ndarray):
         value = array([ value ])
     return ndarray(NDCompare.less_than(self.nda, value.nda))