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

Method eliminate_zeros

ot/backend.py:1336–1344  ·  view source on GitHub ↗
(self, a, threshold=0.0)

Source from the content-addressed store, hash-verified

1334 return csr_matrix(a)
1335
1336 def eliminate_zeros(self, a, threshold=0.0):
1337 if threshold > 0:
1338 if self.issparse(a):
1339 a.data[self.abs(a.data) <= threshold] = 0
1340 else:
1341 a[self.abs(a) <= threshold] = 0
1342 if self.issparse(a):
1343 a.eliminate_zeros()
1344 return a
1345
1346 def todense(self, a):
1347 if self.issparse(a):

Callers

nothing calls this directly

Calls 3

issparseMethod · 0.95
absMethod · 0.95
eliminate_zerosMethod · 0.45

Tested by

no test coverage detected