← abs operator page · numeric/abs/ds/manual_ex_1
pandas ✅ · DuckDB ✅
abs on every measure of DS_1.
Absolute value, Example 1, output verbatim: "The operator abs calculates the absolute value of a number."
Me_1 0.484183, -0.515817 and -1.0 give 0.484183, 0.515817 and 1.0; Me_2 0.7545, -13.45 and 187.0 give 0.7545, 13.45 and 187.
DS_r := abs ( DS_1 );
| Id_1 | Id_2 | Me_1 | Me_2 |
|---|---|---|---|
| 10 | A | 0.484183 | 0.7545 |
| 10 | B | -0.515817 | -13.45 |
| 11 | A | -1.000000 | 187.0 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Number", "role": "Measure", "nullable": true},
{"name": "Me_2", "type": "Number", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Me_1 | Me_2 |
|---|---|---|---|
| 10 | A | 0.484183 | 0.7545 |
| 10 | B | 0.515817 | 13.45 |
| 11 | A | 1.000000 | 187 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "Number", "role": "Measure"},
{"name": "Me_2", "type": "Number", "role": "Measure"}
]
}
]
}