turicreate.SArray.abs

SArray.abs()

Returns a new SArray containing the absolute value of each element.

Examples

>>> tc.SArray([1, -1, -2]).abs()
dtype: int
Rows: 3
[1, 1, 2]
>>> tc.SArray([-1., -2.]).abs()
dtype: float
Rows: 2
[1.0, 2.0]