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

前端 未结 6 1136
醉梦人生
醉梦人生 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 17:04

    np.append needs the array as the first argument and the list you want to append as the second:

    mean_data = np.append(mean_data, [ur, ua, np.mean(data[samepoints,-1])])
    

提交回复
热议问题