You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the labels are integers, though, the string syntax falls short:
>>>arr=ndtest("a=0,1,2")
>>>arra012012>>>arr.sum('1;0,2')
ValueError: '1'isnotavalidlabelforanyaxis:
a [3]: 012
This is almost not a bug, because it all comes down to me refusing to make the following work (because in the case of int-like labels, it would prevent targeting a single label):
>>>arr['1']
ValueError: '1'isnotavalidlabelforanyaxis:
a [3]: 012>>>arr.sum('1')
ValueError: '1'isnotavalidlabelforanyaxis:
a [3]: 012
I am still not ready to lift this restriction (even though int-like labels are a bad idea and are not well supported by the string syntax anyway), at least until we have some way to express them (probably related to #34).
However, I think it would be reasonable to support single elements within "aggregation" strings, which we are already interpreting (split on ;). The above case does not work just because we first split on ;then determine whether this must be interpreted.
FWIW, the current workaround is either to avoid using the string syntax or use a sequence of one element instead:
>>>arr['1,']
a11>>>arr.sum('1,;0,2')
a [1], 0,212
but this is not obvious at all.
BTW: the default label is ugly in this case. I think it should be '1,' instead of '[1],', but this should be a separate issue.
The text was updated successfully, but these errors were encountered:
did not make it in 0.34.2, as I am in a hurry to release it. Besides it is a backward-incompatible fix (some could rely on the current behaviour), so doing this in a patch release is kinda bad.
For text labels, it works nicely:
When the labels are integers, though, the string syntax falls short:
This is almost not a bug, because it all comes down to me refusing to make the following work (because in the case of int-like labels, it would prevent targeting a single label):
I am still not ready to lift this restriction (even though int-like labels are a bad idea and are not well supported by the string syntax anyway), at least until we have some way to express them (probably related to #34).
However, I think it would be reasonable to support single elements within "aggregation" strings, which we are already interpreting (split on
;
). The above case does not work just because we first split on;
then determine whether this must be interpreted.FWIW, the current workaround is either to avoid using the string syntax or use a sequence of one element instead:
but this is not obvious at all.
BTW: the default label is ugly in this case. I think it should be '1,' instead of '[1],', but this should be a separate issue.
The text was updated successfully, but these errors were encountered: