-
Notifications
You must be signed in to change notification settings - Fork 6
axis[key] does not work when key contains special characters #200
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
Comments
one way to resolve this would be to implement #34, though I am reluctant to do this. |
Another way would be to first try the key as is in if key in self:
return LGroup(key, name, self)
else:
key = _to_key(key)
return LGroup(key, name, self) and AVOID using We could even return a PGroup directly. This would be more efficient (only translates the group once) in the usual case: use the group on an array containing that axis and slightly less efficient on the unusual case (use the group on an array without the axis). if key in self:
return PGroup(self.translate(key), name, self)
else:
key = _to_key(key)
return PGroup(self.translate(key), name, self) |
not using _to_key in LGroup('10..19', 'teens') But this kind of group should be created using another syntax anyway G['10..19'] >> 'teens' or something like that. See #23. |
implementing #34 seems unavoidable. >>> agg = arr.sum('a1:a2;a0:a1;a0,a2')
>>> agg # option 1 (loose info)
a a1_a2 a0_a1 a0_a2
3 1 2
>>> agg # option 2 (verbose)
a a1_to_a2 a0_to_a1 a0_a2
3 1 2 PS: expanding the slices labels to its labels (e.g. a0:a2 to a0_a1_a2) does not seem like a realistic option |
Uh oh!
There was an error while loading. Please reload this page.
Those messy string evaluations are getting in the way once more
The text was updated successfully, but these errors were encountered: