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

Method _align

numpy/matrixlib/defmatrix.py:246–257  ·  view source on GitHub ↗

A convenience function for operations that need to preserve axis orientation.

(self, axis)

Source from the content-addressed store, hash-verified

244 return NotImplemented
245
246 def _align(self, axis):
247 """A convenience function for operations that need to preserve axis
248 orientation.
249 """
250 if axis is None:
251 return self[0, 0]
252 elif axis == 0:
253 return self
254 elif axis == 1:
255 return self.transpose()
256 else:
257 raise ValueError("unsupported axis")
258
259 def _collapse(self, axis):
260 """A convenience function for operations that want to collapse

Callers 3

argmaxMethod · 0.80
argminMethod · 0.80
ptpMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected