MCPcopy Create free account
hub / github.com/numpy/numpy / _align

Method _align

numpy/matrixlib/defmatrix.py:241–252  ·  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

239 return NotImplemented
240
241 def _align(self, axis):
242 """A convenience function for operations that need to preserve axis
243 orientation.
244 """
245 if axis is None:
246 return self[0, 0]
247 elif axis==0:
248 return self
249 elif axis==1:
250 return self.transpose()
251 else:
252 raise ValueError("unsupported axis")
253
254 def _collapse(self, axis):
255 """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