Skip to content

Streamline re-ordering/merging/dropping columns (Rob) #39

@GluonicPenguin

Description

@GluonicPenguin

So streamline the functions to let user merge columns together, then re-order or drop columns as necessary, for input to fast-plotter, ensuring the index is set for the new merged column (see working code below)

stages:
    - {rename_region: ReBin}
    - {rebin_met: ReBin}
    - {combine_region_met: CombineColumns}
    - {drop_region_met: AssignDim}
    - {save: WriteOut}

rename_region:
    axis: region
    drop_others: true
    mapping:
	0: SR
	6: SB0
	7: SB1
	8: SB2
	9: SB3
	10: SB4

rebin_met:
    axis: met
    drop_others: true
    mapping:
	"[200.0, 300.0)":   "[200.0, 300.0)"
        "[300.0, 400.0)":   "[300.0, 400.0)"
        "[400.0, 500.0)":   "[400.0, 600.0)"
        "[500.0, 600.0)":   "[400.0, 600.0)"
        "[600.0, 700.0)":   "[600.0, 2000.0)"
        "[700.0, 800.0)":   "[600.0, 2000.0)"
        "[800.0, 900.0)":   "[600.0, 2000.0)"
        "[900.0, 1000.0)":   "[600.0, 2000.0)"
        "[1000.0, inf)":   "[600.0, 2000.0)"

combine_region_met:
    format_strings: {"region_met":"{region}_{met}"}
    as_index: [region_met]

drop_region_met:
    drop_cols: [region, category, met]

save: #{}
    filename: "tbl_dataset.region.category.met--sig_regions_fit.csv"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions