WhisperDB Python Pandas Reader
项目描述
WhisperDB Python Pandas Reader
入门
安装
pip install whisper-pandas
作为Python包使用
# Simple to read any Whisper file
>>> from whisper_pandas import WhisperFile
>>> wsp = WhisperFile.read("example.wsp")
# Simple to work with metadata as objects
>>> wsp.meta.archives
[WhisperArchiveMeta(index=0, offset=52, seconds_per_point=10, points=1555200, retention=15552000),
WhisperArchiveMeta(index=1, offset=18662452, seconds_per_point=60, points=5256000, retention=315360000),
WhisperArchiveMeta(index=2, offset=81734452, seconds_per_point=3600, points=87601, retention=315363600)]
# Simple to work with data as `pandas.Series`
>>> wsp.data[1]
2017-02-10 07:07:00+00:00 0.000000
2017-02-10 07:08:00+00:00 0.000000
2017-02-10 07:09:00+00:00 0.000000
2017-02-10 07:10:00+00:00 0.000000
2017-02-10 07:11:00+00:00 0.000000
...
2021-07-20 13:35:00+00:00 4.099915
2021-07-20 13:36:00+00:00 4.104024
2021-07-20 13:37:00+00:00 4.099772
2021-07-20 13:38:00+00:00 4.101358
2021-07-20 13:39:00+00:00 4.099854
Length: 2331015, dtype: float32
作为命令行工具使用
whisper-pandas example.wsp
描述
WhisperDB是一种固定大小的时序格式(见文档)。
官方Python包在这里: whisper
你应该使用它,除非你喜欢Pandas并且只需要读取(而不是写入)Whisper文件,那么你应该使用whisper-pandas
。
为什么?
- 使用起来更简单
- 你不太可能犯错
- 速度更快
目前我们使用whisper.info
内部读取元数据,然后使用Numpy和Pandas读取数据,使用对象来存储元数据和一些便利功能,如快速显示给定文件中可用的数据或读取压缩文件。
未实现部分读取,给定文件总是完整读取,并将数据直接转换为具有日期时间的列式pandas.Series
格式。
开发
欢迎通过Github拉取请求进行贡献。
你可以通过pytest
运行测试。
打包遵循打包Python项目的建议。要发布,请在setup.cfg
中增加版本号并运行那里的命令。
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源代码发行版
whisper-pandas-0.1.tar.gz (4.9 kB 查看哈希值)
构建发行版
whisper_pandas-0.1-py3-none-any.whl (5.4 kB 查看哈希值)
关闭
whisper-pandas-0.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 98bdedc59616eb0e55cf3cb70de11c11f058a7f8c7e99ff1a62d332501f4c601 |
|
MD5 | 30cba876d9a242df83d8bc012d3c2cd8 |
|
BLAKE2b-256 | 8dbf0aeb9fd9e18f1ee238c12b865d7f047a0ed3bddc02140e85d1493a3f3152 |
关闭
whisper_pandas-0.1-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 8d232966e8e0675ed403b1b2acb227711657ca0e36536324d1a2f15ccfa70a56 |
|
MD5 | db37daba58c521844db0552d8b99228b |
|
BLAKE2b-256 | 1880a08b9a97d5bcb8fa55122ee0949f863057ef0580f7e87824e7ea74af4c5a |