utils.boundaries.get_boundaries
utils.boundaries.get_boundaries(data)
Calculates the minimum and maximum values for each column in a NumPy array.
Parameters
data
np .ndarray
A NumPy array of shape (n, k), where n is the number of rows and k is the number of columns.
required
Returns
tuple [np .ndarray , np .ndarray ]
tuple[np.ndarray, np.ndarray]: A tuple containing two NumPy arrays: - The first array contains the minimum values for each column, with shape (k,). - The second array contains the maximum values for each column, with shape (k,).
Raises
ValueError
If the input array has shape (1, 0) (empty array).
Examples
>>> from spotoptim.utils.boundaries import get_boundaries
>>> import numpy as np
>>> data = np.array([[1 , 2 , 3 ], [4 , 5 , 6 ], [7 , 8 , 9 ]])
>>> min_values, max_values = get_boundaries(data)
>>> print ("Minimum values:" , min_values)
Minimum values: [1 2 3 ]
>>> print ("Maximum values:" , max_values)
Maximum values: [7 8 9 ]