datatable.math.abs()¶
Return the absolute value of x. This function can only be applied
to numeric arguments (i.e. boolean, integer, or real).
This function upcasts columns of types bool8, int8 and int16 into
int32; for columns of other types the stype is kept.
Parameters¶
x
FExprColumn expression producing one or more numeric columns.
return
FExprThe resulting FExpr evaluates absolute values in all elements
in all columns of x.
Examples¶
DT = dt.Frame(A=[-3, 2, 4, -17, 0])
DT[:, abs(f.A)]
| A | ||
|---|---|---|
| int32 | ||
| 0 | 3 | |
| 1 | 2 | |
| 2 | 4 | |
| 3 | 17 | |
| 4 | 0 |
See also¶
The content on this page is licensed under the Creative Commons Attribution 4.0 License
(CC BY 4.0) ,
and code samples are licensed under the MIT License.