pymel.util.arrays.length

static arrays.length(a, axis=None)

length(a[, axis=(axis0, axis1, ...)]) –> numeric or Array

Returns length of a, sqrt(a*a) or the square root of the sum of x*x for x in a if a is an iterable of numeric values. If a is an Array and axis are specified will return a list of length(x) for x in a.axisiter(*axis).

>>> A = Array([[0.5,0.5,-0.707],[0.707,-0.707,0.0]])
>>> print A.formated()
[[0.5, 0.5, -0.707],
 [0.707, -0.707, 0.0]]
>>> length(A)
1.4140533936170869
>>> length(A, axis=(0,1))
1.4140533936170869
>>> length(A, axis=0)
Array([0.99992449715, 0.999848988598])
>>> length(A, axis=1)
Array([0.865938219505, 0.865938219505, 0.707])

Previous topic

pymel.util.arrays.ldexp

Next topic

pymel.util.arrays.linmap

Core

Core Modules

Other Modules

This Page