Minimal compression library for sparse or contiguous 1D numpy boolean arrays
Project description
rp-annot
Minimal compression library for sparse or contiguous 1D numpy boolean arrays.
Only depends on numpy
Install
The latest version is available via PyPI (https://pypi.org/project/rp-annot)
pip install rp-annot
Example usage
import rp_annot as rpa
import numpy as np
np_1d_bool_array = np.zeros(100000, dtype=bool)
np_1d_bool_array[20000:50000] = True
compressed = rpa.compress(np_1d_bool_array) # 16 bytes
decompressed = rpa.decompress(compressed, len(np_1d_bool_array))
assert np.array_equal(np_1d_bool_array, decompressed)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rp_annot-0.0.4.tar.gz
(14.7 kB
view details)
File details
Details for the file rp_annot-0.0.4.tar.gz
.
File metadata
- Download URL: rp_annot-0.0.4.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5554c8d9ec536febe6ae0d6bd681641ee7cee95f2a71f2d32fed703a2807b728 |
|
MD5 | 3ab60c515f5943bb618a429c5401a07f |
|
BLAKE2b-256 | 31843f8569fa5a26c3d5ea31cfdd2db34d70b156526a36e29383cab46e3fa9cf |