parameters: (self)
return_statement: return record
docstring: Transforms a masked array into a flexible-type array.
  
          The flexible type array that is returned will have two fields:
  
          * the ``_data`` field stores the ``_data`` part of the array.
          * the ``_mask`` field stores the ``_mask`` part of the array.
  
          Parameters
          ----------
          None
  
          Returns
          -------
          record : ndarray
              A new flexible-type `ndarray` with two fields: the first element
              containing a value, the second element containing the corresponding
              mask boolean. The returned record shape matches self.shape.
  
          Notes
          -----
          A side-effect of transforming a masked array into a flexible `ndarray` is
          that meta information (``fill_value``, ...) will be lost.
  
          Examples
          --------
          >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
          >>> print(x)
          [[1 -- 3]
           [-- 5 --]
           [7 -- 9]]
          >>> print(x.toflex())
          [[(1, False) (2, True) (3, False)]
           [(4, True) (5, False) (6, True)]
           [(7, False) (8, True) (9, False)]]
docstring_summary: Transforms a masked array into a flexible-type array.
docstring_tokens: Transforms a masked array into a flexible - type array .
function: def toflex(self):
          """
          Transforms a masked array into a flexible-type array.
  
          The flexible type array that is returned will have two fields:
  
          * the ``_data`` field stores the ``_data`` part of the array.
          * the ``_mask`` field stores the ``_mask`` part of the array.
  
          Parameters
          ----------
          None
  
          Returns
          -------
          record : ndarray
              A new flexible-type `ndarray` with two fields: the first element
              containing a value, the second element containing the corresponding
              mask boolean. The returned record shape matches self.shape.
  
          Notes
          -----
          A side-effect of transforming a masked array into a flexible `ndarray` is
          that meta information (``fill_value``, ...) will be lost.
  
          Examples
          --------
          >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
          >>> print(x)
          [[1 -- 3]
           [-- 5 --]
           [7 -- 9]]
          >>> print(x.toflex())
          [[(1, False) (2, True) (3, False)]
           [(4, True) (5, False) (6, True)]
           [(7, False) (8, True) (9, False)]]
  
          """
          # Get the basic dtype.
          ddtype = self.dtype
          # Make sure we have a mask
          _mask = self._mask
          if _mask is None:
              _mask = make_mask_none(self.shape, ddtype)
          # And get its dtype
          mdtype = self._mask.dtype
  
          record = np.ndarray(shape=self.shape,
                              dtype=[('_data', ddtype), ('_mask', mdtype)])
          record['_data'] = self._data
          record['_mask'] = self._mask
          return record
function_tokens: def toflex ( self ) : # Get the basic dtype. ddtype = self . dtype # Make sure we have a mask _mask = self . _mask if _mask is None : _mask = make_mask_none ( self . shape , ddtype ) # And get its dtype mdtype = self . _mask . dtype record = np . ndarray ( shape = self . shape , dtype = [ ( '_data' , ddtype ) , ( '_mask' , mdtype ) ] ) record [ '_data' ] = self . _data record [ '_mask' ] = self . _mask return record