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.3.0.tar.gz
(40.6 kB
view hashes)
Close
Hashes for data-disaggregation-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b846836d38999f453bf27672e426745af041d090f6d859b2549eb8531e6797ee |
|
MD5 | 32d3b872baaf4163a9e8f323a1a706da |
|
BLAKE2b-256 | 4c3a4b8dff5dc20dcc742dada39bde1522aa1acf108dfaf9e58ff8e27ffd3b11 |