Python遍历每个元素并删除第n个元素
python 603
原文标题 :Python loop through every element and delete nth element
我无法弄清楚如何遍历数组数组并删除第 n 个元素。 IE。第一个循环将保留所有内容但删除第一个元素,第二个循环将保留所有内容但删除第二个元素等
x1 = np.array([1,2,4,6])
y1 = np.array([2,4,6,3])
x2 = np.array([2,4,2,7])
y2 = np.array([2,5,3,4])
x3 = np.array([3,5,4,3])
y3 = np.array([2,6,1,2])
x4 = np.array([6,6,4,7])
y4 = np.array([8,9,8,4])
xs = np.array([x1,x2,x3,x4])
ys = np.array([y1,y2,y3,x4])
for x, y in zip(xs, ys):
xs_1 = np.delete(xs,0,axis = 1)
ys_1 = np.delete(ys,0,axis = 1)