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

feat: allow wildcards in StrCat list indexing #601

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andrzejnovak
Copy link
Member

@andrzejnovak andrzejnovak commented Feb 13, 2025

For a demo hist like

import hist
import numpy as np
import string

h = hist.new.Reg(10, 0, 10).StrCat([], growth=True).Weight()
N = 100000
for cat in ["ABC", "BCD", "CDE", "DEF"]:
    h.fill(
        np.random.normal(np.random.uniform(0, 10), 1, N), cat
    )
h.plot2d()

image

This allows slicing like

h[:, "*E*"]

image

and

h[:, ["*B*", "?D?"]]

image

@andrzejnovak andrzejnovak force-pushed the wildcards branch 2 times, most recently from 5717edb to fc7c16f Compare February 13, 2025 13:47
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

Successfully merging this pull request may close these issues.

1 participant