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.3.tar.gz
(14.7 kB
view details)
File details
Details for the file rp_annot-0.0.3.tar.gz
.
File metadata
- Download URL: rp_annot-0.0.3.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 | 0be24037a143d49ec530320794c205fe5c596a4b697a17c54ca718c37797bbf5 |
|
MD5 | 17c4ad9f6e3cfe11b08ff585e3bff1b3 |
|
BLAKE2b-256 | 598109c7897f02b0669885cc753ad22b5afdce8e20e8efdfb4241713e14eb15b |