Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GluonicPenguin opened this issue Jul 9, 2020 · 0 comments
Open

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

GluonicPenguin opened this issue Jul 9, 2020 · 0 comments

Comments

@GluonicPenguin
Copy link

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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant