← not operator page · boolean/not/comp/manual_ex_2
pandas ✅ · DuckDB ✅
DS_1 [ calc Me_2 := not Me_1 ]: a new measure that negates the component Me_1.
Logical negation, Example 2, output verbatim: "not false gives true" and "not true gives false".
the page's six data points: Me_1 is kept and Me_2 is its negation on each one.
DS_r:= DS_1 [ calc Me_2 := not Me_1 ];
| Id_1 | Id_2 | Id_3 | Id_4 | Me_1 |
|---|---|---|---|---|
| M | 15 | B | 2013 | True |
| M | 64 | B | 2013 | False |
| M | 65 | B | 2013 | True |
| F | 15 | U | 2013 | False |
| F | 64 | U | 2013 | False |
| F | 65 | U | 2013 | True |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Id_3", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_4", "type": "Time_Period", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Boolean", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Id_3 | Id_4 | Me_1 | Me_2 |
|---|---|---|---|---|---|
| M | 15 | B | 2013 | true | false |
| M | 64 | B | 2013 | false | true |
| M | 65 | B | 2013 | true | false |
| F | 15 | U | 2013 | false | true |
| F | 64 | U | 2013 | false | true |
| F | 65 | U | 2013 | true | false |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier"},
{"name": "Id_2", "type": "Integer", "role": "Identifier"},
{"name": "Id_3", "type": "String", "role": "Identifier"},
{"name": "Id_4", "type": "Time_Period", "role": "Identifier"},
{"name": "Me_1", "type": "Boolean", "role": "Measure"},
{"name": "Me_2", "type": "Boolean", "role": "Measure"}
]
}
]
}