Metadata-Version: 2.1
Name: data-disaggregation
Version: 0.1.2
Summary: Wrapper classes around multidimensional numpy matrices for (dis)aggregation of data.
Home-page: https://github.com/wingechr/data-disaggregation
Author: Christian Winger
Author-email: c.winger@oeko.de
Maintainer: Christian Winger
Maintainer-email: c.winger@oeko.de
License: GPLv3+
Download-URL: https://github.com/wingechr/data-disaggregation
Project-URL: Bug Tracker, https://github.com/wingechr/data-disaggregation
Platform: any
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE

# Data (dis)aggregation

## Install

```bash
pip install data-disaggregation
```

## Quickstart

```python
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(
    name="v1",
    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])
# print as pandas series
print(v2.to_series())


```


