Datect range even if the array has nan values using bottlenck if available