I want to use array slicing to trim my array i.e.
a_trimmed = a[trim_left:-trim_right]
this is great, except if trim_right
is 0, I get a[trim_left:0]
, which is an empty array.
I suppose I can could it to
a[trim_left:a.shape[0]-trim_right]
but it's uglier. What's the cleanest way to express this?