Provides a convenient way to append numpy arrays to a file.
Project description
Provides a convenient way to append numpy arrays to a file.
The NpendWriter and NpendReader classes are used to write and read numpy arrays respectively.
Requirements
- numpy
- sip
Usage
#! -*- coding:utf-8 -*-
from npend import NpendWriter, NpendReader
import numpy as np
if __name__=="__main__":
filePath="test.npd"
nw=NpendWriter(filePath)
arr=np.random.random((34,5,6))# Write an array that has three dimensions.
nw.append(arr)# Keep the size of the last two dimensions the same as the data written before.
arr=np.random.random((10,5,6))
nw.append(arr)
arr=np.random.random((5,6))# Write an array with two dimensions.
nw.append(arr)
nw.close()
nr=NpendReader(filePath)
arr=nr.read()# Load numpy array from file.
print(arr.shape,arr.dtype)
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
npend-1.0.1.tar.gz
(11.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
npend-1.0.1-py3-none-any.whl
(11.7 kB
view details)
File details
Details for the file npend-1.0.1.tar.gz.
File metadata
- Download URL: npend-1.0.1.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec74b3b65be2d1248455d67ef6ce16a5ef8188feb4a7f7731e9cb10dc8d0abaf
|
|
| MD5 |
482ba1ef65ff9fb1ec1384c8696801c5
|
|
| BLAKE2b-256 |
dab88aa9dcffb90216b739ec737c1e09f4af949e721f2833f46da16b52f14c5d
|
File details
Details for the file npend-1.0.1-py3-none-any.whl.
File metadata
- Download URL: npend-1.0.1-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
265776ad8369a4044a14602106b7d68202419c107eaa0cbff75144fac18cecc4
|
|
| MD5 |
72d198b05f9126e72dc0d4a4d121eccc
|
|
| BLAKE2b-256 |
6f72f9422177c920acb34c0de61369eb1872823440e07079cabd88e5ff9d4881
|