dists[(dists >= r) & (dists <= r+dr)] # or if you want to use np.where # dists[(np.where((dists >= r) & (dists <= r + dr)))]