slicing a 2d numpy array
- by MedicalMath
The following code:
import numpy as p
myarr=[[0,1],[0,6],[0,1],[0,6],[0,1],[0,6],[0,1],[0,6],[0,1],[0,6],[0,1],[0,6],[0,1],[0,6],[0,1],[0,6],[0,1],[0,6]]
copy=p.array(myarr)
p.mean(copy)[:,1]
Is generating the following error message:
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
p.mean(copy)[:,1]…