I thought Python (numpy) is zero indexing, but when I slice [:0]
it returns empty array. I thought I'm saying slice from zero to zero but clearly I am not.
If instead I use A[1]
it returns the position 1 element of by zero-indexing.
I thought Python (numpy) is zero indexing, but when I slice [:0]
it returns empty array. I thought I'm saying slice from zero to zero but clearly I am not.
If instead I use A[1]
it returns the position 1 element of by zero-indexing.
When using slice it excludes the endpoint, just like in range(a, b) = a..(b-1)
Though when you do list[:1]
it should return [list[0]]
, not an empty array. Thus I suspect that your array is empty from the beginning.