Skip to main content

load_regular_array

Function load_regular_array 

Source
pub fn load_regular_array<T, D, P>(
    path: P,
    shape: &[usize],
) -> Result<ArrayBase<OwnedRepr<T>, D>, NdimageError>
where T: Float + FromPrimitive + NumCast + Send + Sync + 'static, D: Dimension + 'static, P: AsRef<Path>,
Expand description

Load an array directly into memory from a binary file

This function reads binary data from a file and interprets it as an array of the specified type and shape. This is for smaller files that can fit in RAM.

§Arguments

  • path - Path to the binary file
  • shape - Expected shape of the array

§Returns

A regular ndarray containing the loaded data