{ } Raw JSON

bundles / scipy 1.18.0 / scipy / spatial / transform / _rigid_transform / RigidTransform / __setitem__

function

scipy.spatial.transform._rigid_transform:RigidTransform.__setitem__

source: /scipy/spatial/transform/_rigid_transform.py:1410

Signature

def __setitem__(self, indexer: int | slice | EllipsisType | None | ArrayLike, value: RigidTransform)

Summary

Set transform(s) at given index(es) in this object.

Parameters

indexer : int or slice or array_like

Specifies which transform(s) to replace. A single indexer must be specified, i.e. as if indexing a 1 dimensional array or list.

value : `RigidTransform` instance

The transform(s) to set.

Raises

: TypeError

If the transform is a single transform.

Examples

from scipy.spatial.transform import RigidTransform as Tf
t = [[0, 0, 0], [1, 0, 0], [2, 0, 0]]  # 3 translations
tf = Tf.from_translation(t)
✓
Set a single transform:
tf[0] = Tf.from_translation([9, 9, 9])
tf.translation
✓
array([[9., 9., 9.],
       [1., 0., 0.],
       [2., 0., 0.]])

Aliases

  • scipy.spatial.transform.RigidTransform.__setitem__