Nov-15-2016, 05:06 AM
(This post was last modified: Nov-15-2016, 05:07 AM by winecoding.)
While reading an existing software, I once read the following code segment
For instance, I tried an array of data, which is of shape
crop_data = data[:,offset1:-offset1, offset2:-offset2]I think crop_data will be a slice of data. However, I am not clear how does this slice,
offset1:-offset1, work? Besides, I am not sure which dimensions of original data should be changed.
For instance, I tried an array of data, which is of shape
(1,300,300,1). After setting up
offset1=0 and offset2=0I found the
crop_dataresulted from this
crop_data = data[:,offset1:-offset1, offset2:-offset2]will have shape
(1,0,0,1). I do not know why is that?