0

Does doing basic indexing in ndarray via slice have build-in boundary check?

In the following example, there is no IndexError being raised.

example code:

x=numpy.arange(3)
print( 'x[6:9]',x[6:9] )

output:

x[6:9]=[]
tirth
  • 813
  • 1
  • 8
  • 16
  • [heres the answer](https://stackoverflow.com/questions/22951107/why-pythons-list-slicing-doesnt-produce-index-out-of-bound-error) – Israel-abebe Oct 10 '17 at 11:47
  • @IsraelAbebe thanks – tirth Oct 10 '17 at 12:37
  • Possible duplicate of [Why substring slicing index out of range works in Python?](https://stackoverflow.com/questions/9490058/why-substring-slicing-index-out-of-range-works-in-python) – tirth Oct 10 '17 at 12:39

0 Answers0