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

More pythonic way to find aind and mind for _summarize function #544

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

Conversation

developer0hye
Copy link

More pythonic way to find aind and mind for _summarize function

More pythonic way to find aind and mind for _summarize function
Comment on lines -435 to +436
aind = [i for i, aRng in enumerate(p.areaRngLbl) if aRng == areaRng]
mind = [i for i, mDet in enumerate(p.maxDets) if mDet == maxDets]
aind = p.areaRngLbl.index(areaRng)
mind = p.maxDets.index(maxDets)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That has different semantics though: your code only gives the first match and throws ValueError when nothing matches, whereas the original list allowed for multiple matches and may return an empty list.

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.

2 participants