broadcast_mapping#
- broadcast_mapping(value, ntargets)[source]#
Broadcast a value to a given number of targets.
- Parameters:
value (
floator array_like) – The value(s) to broadcast.ntargets (
int) – The number of targets to broadcast to.
- Returns:
numpy.ndarray– The broadcast (read-only) values, of shape(ntargets,)ifvalueis a scalar or 1D,(ntargets, value.shape[-1])if it is multi-dimensional.
Examples
>>> broadcast_mapping(0.5, 3) array([0.5, 0.5, 0.5])