### Navigation

- index
- modules |
- next |
- previous |
- NumPy v1.3 Manual (DRAFT) »
- NumPy Reference »
- Routines »
- Input and output »

# numpy.save

`numpy.``save`(file, arr)

  Save an array to a binary file in NumPy format.

  Parameters: | f : file or string File or filename to which the data is saved. If the filename does not already have a `.npy` extension, it is added. x : array_like Array data.

  Examples

      >>> from tempfile import TemporaryFile
      >>> outfile = TemporaryFile()

      >>> x = np.arange(10)
      >>> np.save(outfile, x)

      >>> outfile.seek(0)
      >>> np.load(outfile)
      array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

### Navigation

- index
- modules |
- next |
- previous |
- NumPy v1.3 Manual (DRAFT) »
- NumPy Reference »
- Routines »
- Input and output »