What makes the NaN check expensive?
What makes the NaN check expensive?
Posted Jan 5, 2020 17:51 UTC (Sun) by jansson (subscriber, #2227)Parent article: Some median Python NaNsense
Thanks for an interesting article! :)
If all input numbers including NaN's are sorted, and if all NaN's ends up first or last after sorting. We need to check only first and last element after the sort. If any of those two numbers are a NaN then we have NaN in the input. Otherwise there is no NaN in the input! How can these two checks for NaN be expensive?
What did I miss?
