← persistent_assignment operator page · general/persistent_assignment/expression/dataset_subtraction
pandas ✅ · DuckDB ✅
DS_r <- DS_1 - DS_2: the result of an expression assigned to a persistent result.
Persistent assignment: "the operand op can be obtained through an expression as complex as needed (for example op can be the expression DS_1 - DS_2)", and re "assumes the same value as op" and "has the same data structure as the Operand".
The inputs have the same identifiers, so Me_1 is 10 - 3 = 7 and 20 - 5 = 15, Integers (Subtraction page).
DS_r <- DS_1 - DS_2;
| Id_1 | Me_1 |
|---|---|
| 1 | 10 |
| 2 | 20 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 |
|---|---|
| 1 | 3 |
| 2 | 5 |
{
"datasets": [
{
"name": "DS_2",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 |
|---|---|
| 1 | 7 |
| 2 | 15 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Me_1", "type": "Integer", "role": "Measure"}
]
}
]
}