elementwise_norm

halotools.utils.elementwise_norm(x)[source] [edit on github]

Calculate the normalization of each element in a list of n-dimensional points.

Parameters:
x : ndarray

Numpy array of shape (npts, ndim) storing a collection of n-dimensional points

Returns:
result : ndarray

Numpy array of shape (npts, ) storing the norm of each n-dimensional point in x.

Examples

>>> npts = int(1e3)
>>> ndim = 3
>>> x = np.random.random((npts, ndim))
>>> norms = elementwise_norm(x)