pymel.util.arrays.length¶
- 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]] >>> round(length(A), 7) 1.4140534 >>> round(length(A, axis=(0,1)), 7) 1.4140534 >>> length(A, axis=0) Array([0.99992449715, 0.999848988598]) >>> length(A, axis=1) Array([0.865938219505, 0.865938219505, 0.707])