[−][src]Function ndarray_npy::write_npy
pub fn write_npy<P, T>(path: P, array: T) -> Result<(), WriteNpyError> where
P: AsRef<Path>,
T: WriteNpyExt,
Writes an array to an .npy
file at the specified path.
This function will create the file if it does not exist, or overwrite it if it does.
This is a convenience function for using File::create
followed by
WriteNpyExt::write_npy
.
Example
use ndarray::array; use ndarray_npy::write_npy; let arr = array![[1, 2, 3], [4, 5, 6]]; write_npy("array.npy", arr)?;