Skip to main content

No project description provided

Project description

矩阵区间压缩

Quick start

# https://pypi.org/project/range-compression/
pip install range-compression
from range_compression import RangeCompressedMask, mask_encode
from pathlib import Path


mtx = .... # 带有很多连续值的矩阵
rcm = mask_encode(mtx)

X, Y = ..., ... # 要查找的 X, Y
res = rcm.find_index(X, Y)

assert res.shape == X.shape
assert (mtx[Y, X] == res).all()

# 也可以 rcm.save(p)
# 之后在其他地方 rcm = RangeCompressedMask.load(p)

TODO

  • 把性能测试添加到测试和 readme 中
  • 每个版本做性能回归测试
  • 添加更多说明和直接能运行的快速入门

关于 Python 版本

支持 >=3.8, <=3.12

但 numba0.59 已经不再支持 Python3.8,如果以后使用到了 numba 新版本的特性,那么 Python3.8 可能不再会支持

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

range_compression-0.5.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

range_compression-0.5.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file range_compression-0.5.0.tar.gz.

File metadata

  • Download URL: range_compression-0.5.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.6.40-1-MANJARO

File hashes

Hashes for range_compression-0.5.0.tar.gz
Algorithm Hash digest
SHA256 0da84f56f1b31c92eeeab94dddeeae1371bfd156636129161c0b2b30e7afe629
MD5 284c1ce7a8ff764ef7027b259e5dcd17
BLAKE2b-256 e4cb5b69f0080ec2633d46f2d8f1e33bfb4fdae39c797760c5a7f9f1716c7dff

See more details on using hashes here.

File details

Details for the file range_compression-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: range_compression-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.6.40-1-MANJARO

File hashes

Hashes for range_compression-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f24cef3355dc5fcbb9d26af8ad3edef541745640060238545278c8ff13ce02f
MD5 2170e272a82baf9bcaae59d22f3af465
BLAKE2b-256 bd4a81e6dd6fe1a61823fcb5d32cc4a1397847cadaadac7c42ac1a412c460310

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