### Navigation

- index
- modules |
- next |
- previous |
- NumPy v1.3 Manual (DRAFT) »
- NumPy Reference »
- Array objects »
- The N-dimensional array (`ndarray`) »

# numpy.ndarray.astype

`ndarray.``astype`(t)

  Copy of the array, cast to a specified type.

  Parameters: | t : string or dtype Typecode or data-type to which the array is cast.

  Examples

      >>> x = np.array([1, 2, 2.5])
      >>> x
      array([ 1. ,  2. ,  2.5])

      >>> x.astype(int)
      array([1, 2, 2])

### Navigation

- index
- modules |
- next |
- previous |
- NumPy v1.3 Manual (DRAFT) »
- NumPy Reference »
- Array objects »
- The N-dimensional array (`ndarray`) »