You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don’t think this is the intended behavior, even if we were trying to chose the “lower” element in the case where the array length is even. I expect it to return the index of the median value instead.
Although, we are still returning the last index of equivalent values (it appears), and I think it would be preferable to return the first. But, any of those would be correct as long as we document it.
mbostock
changed the title
medianIndex/quantileIndex is off by one
medianIndex/quantileIndex is wrong
May 30, 2023
d3.medianIndex returns one less than the index of the median element. For example:
I don’t think this is the intended behavior, even if we were trying to chose the “lower” element in the case where the array length is even. I expect it to return the index of the median value instead.
Previously #140 #159.
The text was updated successfully, but these errors were encountered: