← cross_join operator page · join/cross_join/keep/keep_one_measure
pandas ✅ · DuckDB ✅
keep Me_1.
Cross Join: "keep will maintain all the identifiers and only the specified non-identifier components of VDS₃".
the cartesian product of DS_1 (Id_1 1, 2) and DS_2 (Id_2 A, B) has 2 × 2 = 4 data points, with Me_1 only: 10, 10, 20 and 20.
DS_r := cross_join(DS_1, DS_2 keep Me_1);
| 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": "Number", "role": "Measure", "nullable": true}
]
}
]
}
| Id_2 | Me_2 |
|---|---|
| A | 1 |
| B | 2 |
{
"datasets": [
{
"name": "DS_2",
"DataStructure": [
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_2", "type": "Number", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 1 | A | 10 |
| 1 | B | 10 |
| 2 | A | 20 |
| 2 | B | 20 |
{
"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"}
]
}
]
}