Wrapper classes around multidimensional numpy matrices for (dis)aggregation of data.
Project description
Data (dis)aggregation
Install
pip install data-disaggregation
Quickstart
from data_disaggregation import Dimension, Variable
# create dimension hierarchies
time = Dimension("time")
hour = time.add_level("hour", [1, 2, 3])
space = Dimension("space")
region = space.add_level("region", ["r1", "r2"])
subregion = region.add_level(
"subregion", {"r1": ["sr1_1", "sr1_2"], "r2": ["sr2_1"]}
)
# create extensive variable
v1 = Variable(
data={
(1, "sr1_1"): 2,
(1, "sr1_2"): 3,
(2, "sr1_2"): 4,
(2, "sr2_1"): 5,
},
domain=[hour, subregion],
vartype="extensive",
)
# transform (aggregate) fo target dimension
v2 = v1.transform(domain=[region])
series = v2.to_series()
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
data-disaggregation-0.2.8.tar.gz
(40.5 kB
view hashes)
Close
Hashes for data-disaggregation-0.2.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52306a515038c344a8792b04d3d07aecd841dc1cbe868b9b8816c473bc9e3c8f |
|
MD5 | 2812cd20be65c5bcb3a698a3702fd581 |
|
BLAKE2b-256 | 2934aed0b289fe6a8a09081b0b4d9b6bc28d27056ba08039a738339de98cac04 |