I want to extract the values from "all", for which the first columns is 0 or 1.
arr = np.zeros((0,2))
for num in [0,1]:
spike = np.vstack((arr, all[all[:,0] == num] ))
print(spike)
When i print "spike" only the values of 1 are present.
您在循环中覆盖了spike
的值。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.