[issue39864] IndexError gives wrong axis info

2020-03-05 Thread Ningyi Du
Ningyi Du added the comment: I believe it's a bug. The axis 0 is misleading. However, it is a problem for numpy developers. Thank you for your time. On Thu, Mar 5, 2020, 10:42 AM Peter Otten wrote: > > Peter Otten <__pete...@web.de> added the comment: > > This is not a bug (and if it were

[issue39864] IndexError gives wrong axis info

2020-03-05 Thread Peter Otten
Peter Otten <__pete...@web.de> added the comment: This is not a bug (and if it were you would have to report to numpy, not cpython). Consider: >>> import numpy >>> a = numpy.zeros((2,2,2)) >>> a[0,2] Traceback (most recent call last): File "", line 1, in IndexError: index 2 is out of

[issue39864] IndexError gives wrong axis info

2020-03-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is a numpy issue, you will need to report it to the numpy developers. But first you need to check that it really is a bug. What makes you think it is a bug? In your example, index 3 looks out of bounds to me. Remember that indexes start at 0, not 1.

[issue39864] IndexError gives wrong axis info

2020-03-05 Thread Ningyi Du
Ningyi Du added the comment: This is a simple test: test=np.zeros((2,3,4)) print(test[1][3][1]) IndexErrorTraceback (most recent call last) in 1 test=np.zeros((2,3,4)) > 2 print(test[1][3][1]) IndexError: index 3 is out of bounds for axis 0 with

[issue39864] IndexError gives wrong axis info

2020-03-05 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Please include a sample script to reproduce the program along with a description of why you think it's an error in CPython. This seems to be a custom exception raised by a library. -- nosy: +xtreak ___

[issue39864] IndexError gives wrong axis info

2020-03-05 Thread Ningyi Du
New submission from Ningyi Du : IndexError: index 11 is out of bounds for axis 0 with size 11 The actual error is not with axis 0, but axis 3. error message: 168 if iJ>=9: 169 print(iE,iE0,iEtemp,iJ,li,lf,mlf+lf) --> 170