Ensures that the named axes are stored in a canonical order. Returns: Equivalent `NamedArray` whose data array contains the positional axes followed by the named axes in sorted order.
(self)
| 1010 | return self.broadcast_to(shape, {}) |
| 1011 | |
| 1012 | def canonicalize(self) -> NamedArray: |
| 1013 | """Ensures that the named axes are stored in a canonical order. |
| 1014 | |
| 1015 | Returns: |
| 1016 | Equivalent `NamedArray` whose data array contains the positional axes |
| 1017 | followed by the named axes in sorted order. |
| 1018 | """ |
| 1019 | return self.order_as(*sorted(self.named_shape.keys())) |
| 1020 | |
| 1021 | # Indexing. |
| 1022 | def __getitem__(self, indexer) -> NamedArray | NamedArrayView: |