Skip to main content

Efficient compression and decompression of unsigned integer arrays using binary representation.

Project description

Efficient compression and decompression of unsigned integer arrays using binary representation.

pip install zipint

Efficient compression and decompression of unsigned integer arrays using binary representation.

This module provides functions for compressing and decompressing integer arrays efficiently
using binary representation. It is designed to work with 2D numpy arrays and supports compression
and decompression of unsigned integers in a way that minimizes storage space.

Usage:
from zipint import zipint,unzipint
import numpy as np
import pandas as pd

df=pd.DataFrame(np.random.randint(2,1000,(5,5)))
print(df.to_string())
f1=zipint(df)
print(f'{f1=}')
f2=unzipint(f1)
print(f'{f2=}')
df2=pd.DataFrame(f2)
print(df2.to_string())

#      0    1    2    3    4
# 0  393  489  469    4  777
# 1  436  322  491  753  143
# 2  257  275  920  303  176
# 3  654  981  337  395  211
# 4  444  337  972  251  749


# f1=array([432633621254921, 479733330199695, 282870732340400, 720134299069651,
#        488546033200877], dtype=uint64)


# f2=array([[393, 489, 469,   4, 777],
#        [436, 322, 491, 753, 143],
#        [257, 275, 920, 303, 176],
#        [654, 981, 337, 395, 211],
#        [444, 337, 972, 251, 749]], dtype=uint64)


#      0    1    2    3    4
# 0  393  489  469    4  777
# 1  436  322  491  753  143
# 2  257  275  920  303  176
# 3  654  981  337  395  211
# 4  444  337  972  251  749

Note: The module uses binary representation to efficiently store and retrieve unsigned integer values.
The compressed data is stored as uint64 for optimization. If overflow occurs during conversion,
the data is stored as an object type array.

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

zipint-0.10.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

zipint-0.10-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file zipint-0.10.tar.gz.

File metadata

  • Download URL: zipint-0.10.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for zipint-0.10.tar.gz
Algorithm Hash digest
SHA256 f4ff59b31a4a442ea6a79d562b656ddedee2c9d792b372fabb48e73a84e86c5d
MD5 19d25fa21ab87f1d5c43fe49fcc82a47
BLAKE2b-256 08c2ade9774852fad1b7b115b0d80c87b3f0d3c23212be9f7f8fa2768dd75290

See more details on using hashes here.

File details

Details for the file zipint-0.10-py3-none-any.whl.

File metadata

  • Download URL: zipint-0.10-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for zipint-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 746cde93c241a49b61788c176d5fc860cf3056b43a9c9bf697388bf869d8a2d2
MD5 954c454d9129256407a84f63376c9f9c
BLAKE2b-256 a04a264467cb8842a2f2410b20d8316209da0410ac3c8ad1141f51017cdda311

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