Python Forum
IndexError: index 0 is out of bounds for axis 0 with size 0 error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IndexError: index 0 is out of bounds for axis 0 with size 0 error
#5
(Apr-24-2020, 02:52 PM)Jeff900 Wrote: A traceback is what you get as response when an error occurred. Like this:

Output:
>>> 1 + a Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'a' is not defined >>>
It gives a bit more info then just the error.

Like I said Jeff, your suggestion dosen't apply here.
The only available traceback is:
----> 5     t1_seed = df_seeds[(df_seeds.TeamID == t1) & (df_seeds.Season == year)].seed_int.values[0]
and the following:
IndexError                                Traceback (most recent call last)
<ipython-input-37-0215f157ee60> in <module>
      3 for ii, row in df_sample_sub.iterrows():
      4     year, t1, t2 = get_year_t1_t2(row.ID)
----> 5     t1_seed = df_seeds[(df_seeds.TeamID == t1) & (df_seeds.Season == year)].seed_int.values[0]
      6     t2_seed = df_seeds[(df_seeds.TeamID == t2) & (df_seeds.Season == year)].seed_int.values[0]
      7     diff_seed = t1_seed - t2_seed
 
Reply


Messages In This Thread
RE: IndexError: index 0 is out of bounds for axis 0 with size 0 error - by tmhsa - Apr-24-2020, 05:52 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,660 Sep-14-2023, 06:54 AM
Last Post: Mehboob
  pyscript index error while calling input from html form pyscript_dude 2 1,158 May-21-2023, 08:17 AM
Last Post: snippsat
  Index error help MRsquared 1 901 May-15-2023, 03:28 PM
Last Post: buran
Exclamation IndexError: Replacement index 2 out of range for positional args tuple - help? MrKnd94 2 7,254 Oct-14-2022, 09:57 PM
Last Post: MrKnd94
  IndexError: list index out of range dolac 4 2,143 Jul-25-2022, 03:42 PM
Last Post: deanhystad
  I'm getting a String index out of range error debian77 7 2,600 Jun-26-2022, 09:50 AM
Last Post: deanhystad
  IndexError: list index out of range Anldra12 2 1,572 May-03-2022, 01:39 PM
Last Post: Anldra12
  For loop index out of bounds armitron121 2 2,826 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,705 Sep-14-2021, 08:29 AM
Last Post: hobbyist
  IndexError: list index out of range rf_kartal 6 3,075 Sep-07-2021, 02:36 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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