Python Forum
when this error rise?index 28 is out of bounds for axis 0 with size 13
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
when this error rise?index 28 is out of bounds for axis 0 with size 13
#2
Here's a simpler example:
import numpy as np
hg=np.zeros([13,29])
for i in range(29):
    for j in range(13):
        hg[i][j] = 1*13+j
Output:
Traceback (most recent call last): File "...", line 5, in <module> hg[i][j] = 1*13+j IndexError: index 13 is out of bounds for axis 0 with size 13
See the problem now? Look at the values for i and the shape of hg.

There may be other problems.
Reply


Messages In This Thread
RE: when this error rise?index 28 is out of bounds for axis 0 with size 13 - by deanhystad - Nov-10-2020, 08:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  IndexError: index 10 is out of bounds for axis 0 with size 10 Mehboob 11 2,624 Sep-14-2023, 06:54 AM
Last Post: Mehboob
  pyscript index error while calling input from html form pyscript_dude 2 1,152 May-21-2023, 08:17 AM
Last Post: snippsat
  Index error help MRsquared 1 893 May-15-2023, 03:28 PM
Last Post: buran
  I'm getting a String index out of range error debian77 7 2,595 Jun-26-2022, 09:50 AM
Last Post: deanhystad
  For loop index out of bounds armitron121 2 2,816 Feb-08-2022, 04:23 PM
Last Post: armitron121
  Sample labels from excel file in order to put them on x-axis and y-axis of a plot hobbyist 11 4,694 Sep-14-2021, 08:29 AM
Last Post: hobbyist
  Python Error List Index Out of Range abhi1vaishnav 3 2,510 Sep-03-2021, 08:40 PM
Last Post: abhi1vaishnav
  Index error - columns vs non-column Vinny 3 5,128 Aug-09-2021, 04:46 PM
Last Post: snippsat
  How to resolve Index Error in my code? codify110 6 3,302 May-22-2021, 11:04 AM
Last Post: supuflounder
  IndexError: index 10 is out of bounds for axis 0 with size 1 vahid89 1 12,497 Jan-07-2021, 06:19 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020