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"
.
Installation
pip install npy-append-array
Usage
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'
# optional, .append will create file automatically if not exists
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.5.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for npy_append_array-0.9.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e86916ea789a1af8c2f51d8a151b3feb42ed1917d486d7443d4b7b799f27d82 |
|
MD5 | 43f08c8db37176f845439155cb04a2bc |
|
BLAKE2b-256 | 263bcd77087bba835f0adacfbfeaa558e7097919fc0631acf060bc2047224555 |