← division operator page · numeric/division/ds_ds/manual_ex_1
pandas ✅ · DuckDB ✅
each measure of DS_1 divided by the same measure of DS_2, on the data points that the two datasets share.
Division, Example 1, output verbatim: "The operator ... divides two numbers."
only (10, A) and (11, B) are in both datasets: 7.6 / 2.0 = 3.8 and 20.0 / 1.0 = 20.0.
DS_r := DS_1 / DS_2;
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 10 | A | 7.6 |
| 10 | B | 12.3 |
| 11 | A | 25.0 |
| 11 | B | 20.0 |
{
"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": "Number", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 10 | A | 2.0 |
| 10 | C | 3.0 |
| 11 | B | 1.0 |
{
"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_1", "type": "Number", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 10 | A | 3.8 |
| 11 | B | 20.0 |
{
"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"}
]
}
]
}