import dascore as dc
= dc.get_example_patch("random_das")
pa # Get a patch with non-coordinate dimensions
= pa.mean()
patch = patch.make_broadcastable_to(shape=(2, 3))
out assert out.shape == (2, 3)
make_broadcastable_to
make_broadcastable_to(
self: Patch ,
shape: tuple[int, …] ,
drop_coords = False,
)-> ‘PatchType’
Update the coordiantes of a patch.
Will either add new coordinates, or update existing ones.
Parameters
Parameter | Description |
---|---|
shape | The new shape the patch should be able to broadcast with. |
drop_coords |
If True, drop coords that need to be broadcasted up, otherwise only NonCoordinate dimensions can change shape. |