Custom quantile calculation tools using Hyndman & Fan (1996) methods.
Project description
quantiletools
quantiletools is a Python package that implements the 9 quantile types defined in Hyndman & Fan (1996), with pure Python logic and no dependency on NumPy's np.quantile() methods.
🚀 Features
- Implements Types 1–9 from Hyndman & Fan (1996)
- No reliance on
np.quantile(method=...) - Dataset-level and group-level quantile summaries
- Fully vectorized for performance
📦 Installation
If downloaded locally:
pip install .
## 📚 Example Usage
```python
# Import from package
from quantiletools import quantiles_for_vars, quantiles_by_group
# Example DataFrame
import pandas as pd
import numpy as np
df = pd.DataFrame({
"X1": np.random.randn(10),
"X2": np.random.randn(10),
"Group": np.random.choice(["A", "B"], size=10)
})
# Compute quantiles
quantiles_for_vars(df, ["X1", "X2"], probs=[0.1, 0.5, 0.9], qtype=[1, 7])
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
quantiletools-0.1.0.tar.gz
(4.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quantiletools-0.1.0.tar.gz.
File metadata
- Download URL: quantiletools-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbef066437dcdf343edd754f771a64d99adb89da620e58d3a6bfc99bffd71c0e
|
|
| MD5 |
1fcb5ec7b9212da98ef486c73e0c5021
|
|
| BLAKE2b-256 |
abcd13e272fc0a4a735ed80d87feb9d2b6502febd9a0621f9497adfe8baa8f08
|
File details
Details for the file quantiletools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: quantiletools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7293d93a34dd36dcee2e316f449e06e4b3816fa57661f558898dbd1271b35d6c
|
|
| MD5 |
fc040a81be4ffe684ced99c4d52a0158
|
|
| BLAKE2b-256 |
b2f1689f229e3e51c3116a263bcdb7a79ace76197e88304b2a59bbf662197950
|