A convenience function for operations that need to preserve axis orientation.
(self, axis)
| 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 |