pub fn create_new_npy<P, T>(path: P, array: &T) -> Result<(), WriteNpyError>Expand description
Writes an array to a new .npy file at the specified path; error if the file exists.
This is a convenience function for BufWriter::new(File::create_new(path)?) followed by
WriteNpyExt::write_npy.
ยงExample
use ndarray::array;
use ndarray_npy::create_new_npy;
let arr = array![[1, 2, 3], [4, 5, 6]];
create_new_npy("new_array.npy", &arr)?;
assert!(create_new_npy("new_array.npy", &arr).is_err());