Crate ndarray_npy

Crate ndarray_npy 

Source
Expand description

This crate provides methods to read/write ndarray’s ArrayBase type from/to .npy and .npz files.

See the repository for information about the default features and how to use this crate with Cargo.

§.npy Files

It’s possible to create .npy files larger than the available memory with write_zeroed_npy and then modify them by memory-mapping and using ViewMutNpyExt.

§.npz Files

§Limitations

  • Parsing of .npy files is currently limited to files where the descr field of the header dictionary is a Python string literal of the form 'string', "string", '''string''', or """string""".

  • The element traits (WritableElement, ReadableElement, ViewElement, and ViewMutElement) are currently implemented only for fixed-size integers up to 64 bits, floating point numbers, complex floating point numbers (if enabled with the crate feature), and bool.

The plan is to add support for more element types (including custom user-defined structs) in the future.

Re-exports§

pub use crate::npy::create_new_npy;
pub use crate::npy::read_npy;
pub use crate::npy::write_npy;
pub use crate::npy::write_zeroed_npy;
pub use crate::npy::ReadDataError;
pub use crate::npy::ReadNpyError;
pub use crate::npy::ReadNpyExt;
pub use crate::npy::ReadableElement;
pub use crate::npy::ViewDataError;
pub use crate::npy::ViewElement;
pub use crate::npy::ViewMutElement;
pub use crate::npy::ViewMutNpyExt;
pub use crate::npy::ViewNpyError;
pub use crate::npy::ViewNpyExt;
pub use crate::npy::WritableElement;
pub use crate::npy::WriteDataError;
pub use crate::npy::WriteNpyError;
pub use crate::npy::WriteNpyExt;

Modules§

npy
Functionality for .npy files.

Structs§

NpzReadernpz
Reader for .npz files.
NpzWriternpz
Writer for .npz files.

Enums§

ReadNpzErrornpz
An error reading a .npz file.
WriteNpzErrornpz
An error writing a .npz file.