Skip to content

all_combos_agg: ignore producing certain subtotals from column list #189

@rachelekren

Description

@rachelekren

Description

See code below.
Say you want to not keep the subtotals of certain combinations in all_combos_agg.
Is there a way to send in certain columns so that rows with their subtotals are never produced (hopefully saving some processing time and RAM).

Maybe make a new parameter for this like "ignore_subtotals_cols"?

groupvars_sosbak = {
    'foreldreutd': '00',
    'fylke': '0',
    'kjonn': '0',
    'tid': 'SLETT MEG',
    'prove': 'SLETT MEG',
    'mnivaa': 'SLETT MEG',
    'klassetrinn': 'SLETT MEG',
}
statvar = {
    "elever": "sum",
    "skalapoeng": "mean",
}

all_combos_agg(
        nasjprov_data,
        groupcols=list(groupvars_sosbak.keys()),
        aggargs=statvar,
        fillna_dict=groupvars_sosbak,
        keep_empty=True
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions