rheineke / pymedian

Optimal running median data structure in Python
MIT License
0 stars 0 forks source link

ENH: Handle ignore values #5

Open rheineke opened 7 years ago

rheineke commented 7 years ago

Null values (numpy.nan, for example) are not handled correctly in the min- and max-heaps since they always compare false to other values. Implement an option to add null values to underlying data structure, but in a defined way:

Roughly, match numpy.sort behavior. Null values are moved to the end of a list containing them (TODO: Confirm that this is true even if ordering is reversed). This will cause the median container to be as large as the number of items that are pushed to it.