### Navigation

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

# numpy.ndarray.fill

`ndarray.``fill`(value)

  Fill the array with a scalar value.

  Parameters: | a : ndarray Input array value : scalar All elements of a will be assigned this value.

  Examples

      >>> a = np.array([1, 2])
      >>> a.fill(0)
      >>> a
      array([0, 0])
      >>> a = np.empty(2)
      >>> a.fill(1)
      >>> a
      array([ 1.,  1.])

### Navigation

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