nanmedian bug in Bottleneck 0.4.3

11 views
Skip to first unread message

Keith Goodman

unread,
May 4, 2011, 10:12:29 PM5/4/11
to bottl...@googlegroups.com
The nanmedian function in Bottleneck 0.4.3 contains a bug.

The output of nanmedian is wrong for particular orderings of NaN and
non-NaN elements.

Wrong:

>> bn.nanmedian([1, np.nan, np.nan, 2])
1.0

Right:

>> bn.nanmedian([1, 2, np.nan, np.nan])
1.5
>> bn.nanmedian([1, np.nan, 2, np.nan])
1.5

The bug has been fixed in Bottleneck 0.5.0dev [1].

[1] https://github.com/kwgoodman/bottleneck/commit/0fd01aa50623510c6032559acd82e2d30ac464e3

Reply all
Reply to author
Forward
0 new messages