Map
Processor that remaps the values of a column according to a lookup table, optionally writing the result to a new column. It is used to recode labels, for example collapsing particle types into class indices.
Configuration
Selected as name: map.
Option |
Description |
Type |
Default |
|---|---|---|---|
|
Column whose values are remapped. |
str | int |
required |
|
Lookup table of old value to new value. |
mapping |
required |
|
Fail if a value is missing from the table (otherwise it is left unchanged). |
bool |
|
|
Destination column; defaults to overwriting |
str | int |
overwrite |
- name: map
kwargs:
col: pdg
map: { 12: 0, 14: 1, 16: 2 }
out: flavor