← inner_join operator page · join/inner_join/drop/manual_ex_2
pandas ✅ · DuckDB ✅
drop d1#Me_2, the page's only example of drop, after a filter and a calc, on two operands that both have Me_2.
Inner Join, Example 2, output verbatim: "drop will remove all specified non-identifier components of VDS₃", and then the prefixes of the components that were in several data sets are stripped.
the join keeps (1,A) and (1,B); filter Me_1 = "A" keeps (1,A), calc Me_4 := Me_1 || Me_1A gives the Measure AB, and d2#Me_2 becomes Me_2 = Q.
DS_r := inner_join (DS_1 as d1, DS_2 as d2 filter Me_1 = "A" calc Me_4 := Me_1 || Me_1A drop d1#Me_2);
| Id_1 | Id_2 | Me_1 | Me_2 |
|---|---|---|---|
| 1 | A | A | B |
| 1 | B | C | D |
| 2 | A | E | F |
{
"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": "String", "role": "Measure", "nullable": true},
{"name": "Me_2", "type": "String", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Me_1A | Me_2 |
|---|---|---|---|
| 1 | A | B | Q |
| 1 | B | S | T |
| 3 | A | Z | M |
{
"datasets": [
{
"name": "DS_2",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1A", "type": "String", "role": "Measure", "nullable": true},
{"name": "Me_2", "type": "String", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Me_1 | Me_1A | Me_2 | Me_4 |
|---|---|---|---|---|---|
| 1 | A | A | B | Q | AB |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "String", "role": "Measure"},
{"name": "Me_1A", "type": "String", "role": "Measure"},
{"name": "Me_2", "type": "String", "role": "Measure"},
{"name": "Me_4", "type": "String", "role": "Measure"}
]
}
]
}