Allows to create Numpy `.npy` files that are larger than the main memory
Project description
NpyAppendArray
Allows to create Numpy .npy
files that are larger than the main memory of the
machine by appending on the zero axis. The file can then be read with
mmap_mode="r"
.
from npy_append_array import NpyAppendArray
import numpy as np
arr1 = np.array([[1,2],[3,4]])
arr2 = np.array([[1,2],[3,4],[5,6]])
filename='out.npy'
# line may be removed, still works correctly if filename does not exist
np.save(filename, arr1)
npaa = NpyAppendArray(filename)
npaa.append(arr2)
npaa.append(arr2)
npaa.append(arr2)
data = np.load(filename, mmap_mode="r")
print(data)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
npy-append-array-0.9.3.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for npy_append_array-0.9.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab85b96dd1a4a78cc4aaf0aa57a6f8c346208ad136c76e911d83e1d088ed32f8 |
|
MD5 | 6b2fa5df59268a8bfb9ce97d3628f2ff |
|
BLAKE2b-256 | 302be3e946fc8effaba302e5286c36c2ed12a73d9f2db4ea6e194266dcb8ce0a |