parameters: (self, axis=None, keepdims=np._NoValue)
return_statement: return (~m).sum(axis=axis, dtype=np.intp, **kwargs)
docstring: Count the non-masked elements of the array along the given axis.
  
          Parameters
          ----------
          axis : None or int or tuple of ints, optional
              Axis or axes along which the count is performed.
              The default, None, performs the count over all
              the dimensions of the input array. `axis` may be negative, in
              which case it counts from the last to the first axis.
  
              .. versionadded:: 1.10.0
  
              If this is a tuple of ints, the count is performed on multiple
              axes, instead of a single axis or all the axes as before.
          keepdims : bool, optional
              If this is set to True, the axes which are reduced are left
              in the result as dimensions with size one. With this option,
              the result will broadcast correctly against the array.
  
          Returns
          -------
          result : ndarray or scalar
              An array with the same shape as the input array, with the specified
              axis removed. If the array is a 0-d array, or if `axis` is None, a
              scalar is returned.
  
          See Also
          --------
          count_masked : Count masked elements in array or along a given axis.
  
          Examples
          --------
          >>> import numpy.ma as ma
          >>> a = ma.arange(6).reshape((2, 3))
          >>> a[1, :] = ma.masked
          >>> a
          masked_array(
            data=[[0, 1, 2],
                  [--, --, --]],
            mask=[[False, False, False],
                  [ True,  True,  True]],
            fill_value=999999)
          >>> a.count()
          3
  
          When the `axis` keyword is specified an array of appropriate size is
          returned.
  
          >>> a.count(axis=0)
          array([1, 1, 1])
          >>> a.count(axis=1)
          array([3, 0])
docstring_summary: Count the non-masked elements of the array along the given axis.
docstring_tokens: Count the non - masked elements of the array along the given axis .
function: def count(self, axis=None, keepdims=np._NoValue):
          """
          Count the non-masked elements of the array along the given axis.
  
          Parameters
          ----------
          axis : None or int or tuple of ints, optional
              Axis or axes along which the count is performed.
              The default, None, performs the count over all
              the dimensions of the input array. `axis` may be negative, in
              which case it counts from the last to the first axis.
  
              .. versionadded:: 1.10.0
  
              If this is a tuple of ints, the count is performed on multiple
              axes, instead of a single axis or all the axes as before.
          keepdims : bool, optional
              If this is set to True, the axes which are reduced are left
              in the result as dimensions with size one. With this option,
              the result will broadcast correctly against the array.
  
          Returns
          -------
          result : ndarray or scalar
              An array with the same shape as the input array, with the specified
              axis removed. If the array is a 0-d array, or if `axis` is None, a
              scalar is returned.
  
          See Also
          --------
          count_masked : Count masked elements in array or along a given axis.
  
          Examples
          --------
          >>> import numpy.ma as ma
          >>> a = ma.arange(6).reshape((2, 3))
          >>> a[1, :] = ma.masked
          >>> a
          masked_array(
            data=[[0, 1, 2],
                  [--, --, --]],
            mask=[[False, False, False],
                  [ True,  True,  True]],
            fill_value=999999)
          >>> a.count()
          3
  
          When the `axis` keyword is specified an array of appropriate size is
          returned.
  
          >>> a.count(axis=0)
          array([1, 1, 1])
          >>> a.count(axis=1)
          array([3, 0])
  
          """
          kwargs = {} if keepdims is np._NoValue else {'keepdims': keepdims}
  
          m = self._mask
          # special case for matrices (we assume no other subclasses modify
          # their dimensions)
          if isinstance(self.data, np.matrix):
              if m is nomask:
                  m = np.zeros(self.shape, dtype=np.bool_)
              m = m.view(type(self.data))
  
          if m is nomask:
              # compare to _count_reduce_items in _methods.py
  
              if self.shape == ():
                  if axis not in (None, 0):
                      raise np.AxisError(axis=axis, ndim=self.ndim)
                  return 1
              elif axis is None:
                  if kwargs.get('keepdims', False):
                      return np.array(self.size, dtype=np.intp, ndmin=self.ndim)
                  return self.size
  
              axes = normalize_axis_tuple(axis, self.ndim)
              items = 1
              for ax in axes:
                  items *= self.shape[ax]
  
              if kwargs.get('keepdims', False):
                  out_dims = list(self.shape)
                  for a in axes:
                      out_dims[a] = 1
              else:
                  out_dims = [d for n, d in enumerate(self.shape)
                              if n not in axes]
              # make sure to return a 0-d array if axis is supplied
              return np.full(out_dims, items, dtype=np.intp)
  
          # take care of the masked singleton
          if self is masked:
              return 0
  
          return (~m).sum(axis=axis, dtype=np.intp, **kwargs)
function_tokens: def count ( self , axis = None , keepdims = np . _NoValue ) : kwargs = { } if keepdims is np . _NoValue else { 'keepdims' : keepdims } m = self . _mask # special case for matrices (we assume no other subclasses modify # their dimensions) if isinstance ( self . data , np . matrix ) : if m is nomask : m = np . zeros ( self . shape , dtype = np . bool_ ) m = m . view ( type ( self . data ) ) if m is nomask : # compare to _count_reduce_items in _methods.py if self . shape == ( ) : if axis not in ( None , 0 ) : raise np . AxisError ( axis = axis , ndim = self . ndim ) return 1 elif axis is None : if kwargs . get ( 'keepdims' , False ) : return np . array ( self . size , dtype = np . intp , ndmin = self . ndim ) return self . size axes = normalize_axis_tuple ( axis , self . ndim ) items = 1 for ax in axes : items *= self . shape [ ax ] if kwargs . get ( 'keepdims' , False ) : out_dims = list ( self . shape ) for a in axes : out_dims [ a ] = 1 else : out_dims = [ d for n , d in enumerate ( self . shape ) if n not in axes ] # make sure to return a 0-d array if axis is supplied return np . full ( out_dims , items , dtype = np . intp ) # take care of the masked singleton if self is masked : return 0 return ( ~ m ) . sum ( axis = axis , dtype = np . intp , * * kwargs )