← setdiff operator page · set/setdiff/two/manual_ex_2
pandas ✅ · DuckDB ✅
setdiff ( DS_3, DS_4 ) on data sets with three identifiers, where DS_4 holds two of the three data points of DS_3.
Set difference, Example 2, output verbatim: the resulting Dataset contains "all the data points Data Point dp1 of the operand ds1, such that there is no Data Point dp2 of ds2 having the same values for homonym Identifier Components".
the page's one data point, (R, T, 2011) with the measure 12.
DS_r := setdiff ( DS_3, DS_4 );
| Id_1 | Id_2 | Id_3 | Me_1 |
|---|---|---|---|
| R | M | 2011 | 7 |
| R | F | 2011 | 10 |
| R | T | 2011 | 12 |
{
"datasets": [
{
"name": "DS_3",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_3", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Id_3 | Me_1 |
|---|---|---|---|
| R | M | 2011 | 7 |
| R | F | 2011 | 10 |
{
"datasets": [
{
"name": "DS_4",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_3", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Id_3 | Me_1 |
|---|---|---|---|
| R | T | 2011 | 12 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Id_3", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "Integer", "role": "Measure"}
]
}
]
}