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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for range_compression-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c337cc3c6fd2c1c9487d651f25802b476e82d7ab099f59d0bd6ce751d7d8757 |
|
MD5 | f3342a7f432c0d7f53154dca7ff26c70 |
|
BLAKE2b-256 | 8a0d9d34c5f943b0d98a4a1e011a5cb700cc1b7be359742906de35426b39d7ca |