https://github.com/bm371613/slice-aggregator
A library for aggregating values assigned to indices by slices and the other way around
https://github.com/bm371613/slice-aggregator
data-structures fenwick-tree interval interval-tree prefix-sum slice slice-aggregator
Last synced: 16 days ago
JSON representation
A library for aggregating values assigned to indices by slices and the other way around
- Host: GitHub
- URL: https://github.com/bm371613/slice-aggregator
- Owner: bm371613
- License: mit
- Created: 2018-03-11T15:07:45.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-15T20:46:38.000Z (about 8 years ago)
- Last Synced: 2025-12-17T02:49:13.872Z (3 months ago)
- Topics: data-structures, fenwick-tree, interval, interval-tree, prefix-sum, slice, slice-aggregator
- Language: Python
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
slice-aggregator
================
.. image:: https://travis-ci.org/bm371613/slice-aggregator.svg?branch=master
:target: https://travis-ci.org/bm371613/slice-aggregator
.. image:: https://readthedocs.org/projects/slice-aggregator/badge/?version=latest
:target: http://slice-aggregator.readthedocs.io/en/latest/?badge=latest
A library for aggregating values assigned to indices by slices
.. code-block:: pycon
>>> 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
.. code-block:: pycon
>>> import slice_aggregator
>>> a = slice_aggregator.slices_by_ixs()
>>> a[:-5] += 1
>>> a[-10:10] -= 2.5
>>> a[-10]
-1.5
`Read the docs `_ to find out more!
Installation
------------
.. code-block:: shell
pip install slice-aggregator