array#

bamengine.ops.array(data)[source]#

Create a new numpy array from input data.

Unlike asarray(), this always creates a copy of the data. Returns float64 dtype.

Parameters:

data (list, tuple, or array) – Input data to convert.

Returns:

NumPy array with float64 dtype (always a new copy).

Return type:

array

Examples

>>> import bamengine.ops as ops
>>> original = [1.0, 2.0, 3.0]
>>> arr = ops.array(original)  # Creates a new array
>>> # arr: [1.0, 2.0, 3.0]

Notes

Use asarray() when you don’t need a copy (more efficient). Use array() when you need to ensure modifications don’t affect the original data.