MCPcopy Index your code
hub / github.com/numpy/numpy / _collapse

Method _collapse

numpy/matrixlib/defmatrix.py:259–266  ·  view source on GitHub ↗

A convenience function for operations that want to collapse to a scalar like _align, but are using keepdims=True

(self, axis)

Source from the content-addressed store, hash-verified

257 raise ValueError("unsupported axis")
258
259 def _collapse(self, axis):
260 """A convenience function for operations that want to collapse
261 to a scalar like _align, but are using keepdims=True
262 """
263 if axis is None:
264 return self[0, 0]
265 else:
266 return self
267
268 # Necessary because base-class tolist expects dimension
269 # reduction by x[0]

Callers 9

sumMethod · 0.80
meanMethod · 0.80
stdMethod · 0.80
varMethod · 0.80
prodMethod · 0.80
anyMethod · 0.80
allMethod · 0.80
maxMethod · 0.80
minMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected