Welcome to slice-aggregator’s documentation!

It is a library for aggregating values assigned to indices by slices

>>> import slice_aggregator
>>> a = slice_aggregator.ixs_by_slices()
>>> a[-5] += 1
>>> a[10] -= 2.5
>>> a[-10:]
-1.5

and the other way around

>>> import slice_aggregator
>>> a = slice_aggregator.slices_by_ixs()
>>> a[:-5] += 1
>>> a[-10:10] -= 2.5
>>> a[-10]
-1.5

Installation

pip install slice-aggregator

Indices and tables