pizzarr icon indicating copy to clipboard operation
pizzarr copied to clipboard

Test with negative step

Open keller-mark opened this issue 2 years ago • 2 comments

keller-mark avatar Aug 18 '23 22:08 keller-mark

I was looking at what this would mean and couldn't figure out what you mean by a "negative step"

dblodgett-usgs avatar Jun 22 '24 19:06 dblodgett-usgs

Sorry, should have added more context. I was referring to the numpy / python ability to provide a negative step value:

import numpy as np
a = np.array(range(1, 20))
# array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])

a[5:0:-1]
# array([6, 5, 4, 3, 2])

# also, can provide negative start/end
a[-5:0:-1]
array([15, 14, 13, 12, 11, 10,  9,  8,  7,  6,  5,  4,  3,  2])

keller-mark avatar Jun 22 '24 19:06 keller-mark