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
Unsure what the best API for this would be. It would be pretty easy to add this as Axis methods (e.g. before and after).
For vs who needed this functionality (but she is not the first user who needed something like this), I used the following code:
deflabel_before(axis, label, n=1):
target_label_idx=axis.index(label) -niftarget_label_idx<0:
plural_suffix="s"ifn>1else""raiseValueError(f"{n} position{plural_suffix} before {label!r} is before the start of the '{axis}' axis")
returnaxis.i[target_label_idx]
deflabel_after(axis, label, n=1):
target_label_idx=axis.index(label) +niftarget_label_idx>=len(axis):
plural_suffix="s"ifn>1else""raiseValueError(f"{n} position{plural_suffix} after {label!r} is after the end of the '{axis}' axis")
returnaxis.i[target_label_idx]
Moving those to axis methods would be trivial. But I am now wondering:
couldn't this be achieved using shift? Isn't this the symptom that shift is hard to use?
is there a way to express this using the string syntax?
how will those new methods behave when using X. syntax?
The last two could come later though.
The text was updated successfully, but these errors were encountered:
Unsure what the best API for this would be. It would be pretty easy to add this as Axis methods (e.g. before and after).
For vs who needed this functionality (but she is not the first user who needed something like this), I used the following code:
Moving those to axis methods would be trivial. But I am now wondering:
The last two could come later though.
The text was updated successfully, but these errors were encountered: