- class tensorstore.DimSelection(DimExpression)
Specifies a dimension selection, for starting a dimension expression.
A dimension selection specifies a sequence of dimensions, either by index or label.
Dimension selections may be used as part of a dimension expression to specify the dimensions to which an indexing operation applies.
A
DimSelectionmay be constructed by subscriptingtensorstore.d:Examples
>>> ts.d[0, 1, 2] d[0,1,2] >>> ts.d[0:1, 2, "x"] d[0:1,2,'x'] >>> ts.d[[0, 1], [2]] d[0,1,2] >>> ts.d[[0, 1], ts.d[2, 3]] d[0,1,2,3]Operations¶
- __getitem__(indices: NumpyIndexingSpec) DimExpression
Applies a NumPy-style indexing operation with default index array semantics.
- oindex[indices: NumpyIndexingSpec] DimExpression
Applies a NumPy-style indexing operation with outer indexing semantics.
- vindex[indices: NumpyIndexingSpec] DimExpression
Applies a NumPy-style indexing operation with vectorized indexing semantics.
- translate_to[origins] DimExpression
Translates the domains of the selected input dimensions to the specified origins without affecting the output range.
- translate_by[offsets] DimExpression
Translates (shifts) the domains of the selected input dimensions by the specified offsets, without affecting the output range.
- translate_backward_by[offsets] DimExpression
Translates (shifts) the domains of the selected input dimensions backward by the specified offsets, without affecting the output range.
- stride[strides: Iterable[int | None] | int | None] DimExpression
Strides the domains of the selected input dimensions by the specified amounts.
- transpose[target: DimSelectionLike] DimExpression
Transposes the selected dimensions to the specified target indices.
- label[labels: str | Iterable[str]] DimExpression
Sets (or changes) the labels of the selected dimensions.
- property diagonal : DimExpression
Extracts the diagonal of the selected dimensions.
- mark_bounds_implicit[implicit] DimExpression
Marks the lower/upper bounds of the selected dimensions as implicit/explicit.