Skip to content

[FEATURE] Slicing subsets of categorical axes #616

@pfackeldey

Description

@pfackeldey

It would be great to do:

ax
# >> StrCategory(['DY', 'QCD', 'Higgs'], name='process')

# the following currently fails
ax[["DY", "QCD"]]
# >> StrCategory(['DY', 'QCD'], name='process')  # <-- this is what I'm looking for

similarly to how it works on hist.Hist already:

hist = hist.Hist(ax)

hist[["DY", "QCD"]]
# >> Hist(StrCategory(['DY', 'QCD'], name='process'), storage=Double())

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