What makes the NaN check expensive?
What makes the NaN check expensive?
Posted Jan 7, 2020 18:43 UTC (Tue) by NYKevin (subscriber, #129325)In reply to: What makes the NaN check expensive? by epa
Parent article: Some median Python NaNsense
You don't sort to get median, you do quickselect (or another algorithm), which is O(N) (in the average case).
(Granted, a linear scan for NaN is also O(N), and probably has a better cache hit rate to boot. So I agree with you that performance really shouldn't be a problem here.)
