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 中 [x] 每个版本做性能回归测试 [ ] 添加更多说明和直接能运行的快速入门

关于 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.4.0.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

range_compression-0.4.0-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

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