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.
Metadata
Release files for zipint 0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zipint-0.10.tar.gz | 20.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zipint-0.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.4 kB
Release files / zipint-0.10.tar.gz
| Download URL | zipint-0.10.tar.gz |
|---|---|
| Size | 20.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4ff59b31a4a442ea6a79d562b656ddedee2c9d792b372fabb48e73a84e86c5d
|
|
BLAKE2b-256 checksum How to use checksums |
08c2ade9774852fad1b7b115b0d80c87b3f0d3c23212be9f7f8fa2768dd75290
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / zipint-0.10-py3-none-any.whl
| Download URL | zipint-0.10-py3-none-any.whl |
|---|---|
| Size | 21.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
746cde93c241a49b61788c176d5fc860cf3056b43a9c9bf697388bf869d8a2d2
|
|
BLAKE2b-256 checksum How to use checksums |
a04a264467cb8842a2f2410b20d8316209da0410ac3c8ad1141f51017cdda311
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|