Struct ndarray_npy::NpzWriter[][src]

pub struct NpzWriter<W: Write + Seek> { /* fields omitted */ }

Writer for .npz files.

Example

#[macro_use]
extern crate ndarray;
extern crate ndarray_npy;

use ndarray::prelude::*;
use ndarray_npy::NpzWriter;
use std::fs::File;

let mut npz = NpzWriter::new(File::create("arrays.npz")?);
let a: Array2<i32> = array![[1, 2, 3], [4, 5, 6]];
let b: Array1<i32> = array![7, 8, 9];
npz.add_array("a", &a)?;
npz.add_array("b", &b)?;

Methods

impl<W: Write + Seek> NpzWriter<W>
[src]

Create a new .npz file without compression. See numpy.savez.

Creates a new .npz file with compression. See numpy.savez_compressed.

Adds an array with the specified name to the .npz file.

Auto Trait Implementations

impl<W> Send for NpzWriter<W> where
    W: Send

impl<W> Sync for NpzWriter<W> where
    W: Sync