load_np

ssapy.io.load_np(filename_)[source][source]

Load a NumPy array from a binary file.

This function loads a NumPy array from a file in .npy format. If the file cannot be read, it handles common exceptions and prints an error message. If loading fails, it returns an empty list.

Parameters:

filename_str

The path to the file from which the NumPy array will be loaded.

Returns:

numpy.ndarray or list

The loaded NumPy array. If an error occurs during loading, returns an empty list.

Examples:

>>> arr = load_np('array.npy')
>>> print(arr)
[1 2 3 4 5]