coords.Coords.set#

Coords.set(f)#

Set the coordinates from those in the given array.

Parameters#

f: float array_like, broadcastable to self.shape.

The coordinates to replace the current ones. This can not be used to change the shape of the Coords.

Raises#

ValueError:

If the shape of f does not allow broadcasting to self.shape.

Examples#

>>> x = Coords([[0],[1],[2]])
>>> print(x)
[[0.  0.  0.]
 [1.  0.  0.]
 [2.  0.  0.]]
>>> x.set([0.,1.,0.])
>>> print(x)
[[0.  1.  0.]
 [0.  1.  0.]
 [0.  1.  0.]]