MCPcopy Create free account
hub / github.com/PythonOT/POT / searchsorted

Method searchsorted

ot/backend.py:1238–1247  ·  view source on GitHub ↗
(self, a, v, side="left")

Source from the content-addressed store, hash-verified

1236 return np.argsort(a, axis)
1237
1238 def searchsorted(self, a, v, side="left"):
1239 if a.ndim == 1:
1240 return np.searchsorted(a, v, side)
1241 else:
1242 # this is a not very efficient way to make numpy
1243 # searchsorted work on 2d arrays
1244 ret = np.empty(v.shape, dtype=int)
1245 for i in range(a.shape[0]):
1246 ret[i, :] = np.searchsorted(a[i, :], v[i, :], side)
1247 return ret
1248
1249 def flip(self, a, axis=None):
1250 return np.flip(a, axis)

Callers

nothing calls this directly

Calls 1

searchsortedMethod · 0.45

Tested by

no test coverage detected