← membership operator page · general/membership/measure/manual_ex_1
pandas ✅ · DuckDB ✅
DS_1#Me_1: the measure is kept, and the other measure and the non-viral attribute are dropped.
Membership, Example 1, output verbatim: "If comp is a Measure in ds, then comp is maintained in the result while all other Measures are dropped."
Id_1, Id_2 and Me_1.
DS_r := DS_1#Me_1;
| Id_1 | Id_2 | Me_1 | Me_2 | At_1 |
|---|---|---|---|---|
| 1 | A | 1 | 5 | |
| 1 | B | 2 | 10 | P |
| 2 | A | 3 | 12 |
{
"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": "Integer", "role": "Measure", "nullable": true},
{"name": "Me_2", "type": "Integer", "role": "Measure", "nullable": true},
{"name": "At_1", "type": "String", "role": "Attribute", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 1 | A | 1 |
| 1 | B | 2 |
| 2 | A | 3 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "Integer", "role": "Measure"}
]
}
]
}