assign#

bamengine.ops.assign(target, value)[source]#

Assign value to target array (in-place operation).

This is equivalent to target[:] = value but more explicit.

Parameters:
  • target (array) – Array to modify.

  • value (array or float) – Value(s) to assign.

Examples

>>> import bamengine.ops as ops
>>> prices = np.array([1.0, 2.0, 3.0])
>>> new_prices = np.array([1.5, 2.5, 3.5])
>>> ops.assign(prices, new_prices)
>>> # prices is now [1.5, 2.5, 3.5]