data: replace np.where with np.searchsorted
Suggested by Erik as a faster alternative because it doesn't allocate a whole new array for the operation.
Suggested by Erik as a faster alternative because it doesn't allocate a whole new array for the operation.