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

do a groupby/filter on data keys #20

Open
kain88-de opened this issue Feb 23, 2017 · 0 comments
Open

do a groupby/filter on data keys #20

kain88-de opened this issue Feb 23, 2017 · 0 comments

Comments

@kain88-de
Copy link
Contributor

I have a treant with a lot of data entries called run-* and some others with different names. To get only the one with run-* I currently have to create a list with the keys I like and then iterate over the list of keys.

run_data = (k for k in t.data.keys() if k.startswith('run-'))
for k in run_data:
    data = t.data[k]
    pass

It would be more convenient if I could do

for data in t.data['run-*']:
    pass

I'm not to sure about the syntax here though. It would also mean we allow general regex in the getitem method. But also keep in mind that in over a year of using the library this is the first time I wanted to do something like this.

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