helpers.zero_base

helpers.zero_base(arr)

Normalize the columns by subtracting the minimum element of each column

Parameters

Name Type Description Default
arr numpy.numpy.ArrayLike A numpy ndarray required

Returns

Type Description
numpy.numpy.ndarray A normalized array such that the columns are subtracted by the minimum element of each column

Example:

import pyLHD
x = pyLHD.LatinSquare(size = (5,5), baseline = 3, seed = 1)
x
array([[4, 6, 3, 6, 4],
       [6, 7, 5, 4, 6],
       [3, 5, 6, 5, 5],
       [7, 4, 4, 3, 3],
       [5, 3, 7, 7, 7]])
pyLHD.zero_base(x)
array([[1, 3, 0, 3, 1],
       [3, 4, 2, 1, 3],
       [0, 2, 3, 2, 2],
       [4, 1, 1, 0, 0],
       [2, 0, 4, 4, 4]])