Skip to main content

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

https://pypi.org/project/rp-annot/0.0.1/

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.2.tar.gz (14.7 kB view details)

Uploaded Source

File details

Details for the file rp_annot-0.0.2.tar.gz.

File metadata

  • Download URL: rp_annot-0.0.2.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

Hashes for rp_annot-0.0.2.tar.gz
Algorithm Hash digest
SHA256 dc1cb56d94720ab80b9544bc7730969a7475cf5aa0026b1f23403746f94401e7
MD5 8a217928ebf974024e81f9dddf714a80
BLAKE2b-256 2914c826c2bdf29887b61183200e3e328a3d3e9cacb0a1a626df32ae195c1c62

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page