问答详情
源自:3-6 3.6 描述统计-频数

IndexError: too many indices for array



fill_fre_top_5(index_name)

Traceback (most recent call last):


  File "<ipython-input-86-24a86b21d71c>", line 1, in <module>

    fill_fre_top_5(index_name)


  File "<ipython-input-81-dc082662d61b>", line 6, in fill_fre_top_5

    new_array[0,len(x)] = x


IndexError: too many indices for array


求解为什么出错... 跟老师敲的一样的啊



提问者:AiryEvil 2018-05-20 19:40

个回答

  • 慕姐4397906
    2018-05-23 15:26:30

     new_array[0,len(x)] = x应该是 new_array[0:len(x)] = x,代表重新给数组赋值?