### Navigation

- index
- modules |
- next |
- previous |
- NumPy v1.3 Manual (DRAFT) »
- NumPy Reference »
- Array objects »
- Masked arrays »
- Constants of the `numpy.ma` module »

# numpy.ma.MaskedArray.view

`MaskedArray.``view`(dtype=None, type=None)

  New view of array with the same data.

  Parameters: | dtype : data-type Data-type descriptor of the returned view, e.g. float32 or int16. type : python type Type of the returned view, e.g. ndarray or matrix.

  Examples

      >>> x = np.array([(1, 2)], dtype=[('a', np.int8), ('b', np.int8)])

  Viewing array data using a different type and dtype:

      >>> y = x.view(dtype=np.int16, type=np.matrix)
      >>> print y.dtype
      int16

      >>> print type(y)
      <class 'numpy.core.defmatrix.matrix'>

  Using a view to convert an array to a record array:

      >>> z = x.view(np.recarray)
      >>> z.a
      array([1], dtype=int8)

  Views share data:

      >>> x[0] = (9, 10)
      >>> z[0]
      (9, 10)

### Navigation

- index
- modules |
- next |
- previous |
- NumPy v1.3 Manual (DRAFT) »
- NumPy Reference »
- Array objects »
- Masked arrays »
- Constants of the `numpy.ma` module »