You should profile both and see which works better  - presumably this is less memory efficient than the example from the other issue. (and btw an easy way to tell nans is to say `arr != arr`)