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