-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
Rolling median uses a basic SortedList
implementation (binary search/insert on a Python list).
The SortedList
implementation in sortedcontainers is more advanced and will scale better for larger window sizes.
This should be an added as an optional dependency (e.g. pip install rollling[extras]
) and rolling median should use the third party sortedcontainers implementation if it's available:
try:
from sortedcontainers import SortedList
except Import Error:
from rolling.structures.sorted_list import SortedList
Some minor work is needed to make the SortedList
method names compatible with the calls in the rolling median implementation (or vice versa).