How can I prevent the TypeError: list indices must be integers, not tuple when copying a python list to a numpy array?

前端 未结 6 1135
醉梦人生
醉梦人生 2020-12-07 16:24

I am trying to create 3 numpy arrays/lists using data from another array called mean_data as follows:

---> 39 R = np.array(mean_data[:,0])
     40 P = np.         


        
6条回答
  •  感动是毒
    2020-12-07 16:54

    Just if someone is having this issue and hadn't done list[index, sub-index], you could be having the problem because you're missing a comma between two arrays in an array of arrays (It happened to me).

提交回复
热议问题