索引错误:索引 0 超出轴 0 的范围,大小为 0 PYTHON

时间:2021-03-09 21:42:51

标签: python numpy

当我运行以下函数时

def chicalcultor(theoretical, observed, errors):
  chi = 0
  
  for num in range(580):
    chi += ((pow(theoretical[num] - observed[num], 2)) / (pow(errors[num], 2)))
  return chi

我收到此错误

      5   for num in range(580):
----> 6     chi += ((pow(theoretical[num] - observed[num], 2)) / (pow(errors[num], 2)))
      7   return chi
      8 

IndexError: index 0 is out of bounds for axis 0 with size 0

谁能告诉我我哪里出错了?

0 个答案:

没有答案