Python中如何用numpy删除数据矩阵指定行

举个例子1:

index = np.where(boxs_sorted[:,0,1] < boxs_sorted[0,0,1])[0]
print(index)
filtered_boxs = np.delete(boxs_sorted,index,axis=0)


举个例子2:

import numpy as np
def row(c,data):
    a,b=np.where(data==c)
    return int(a)
data=np.loadtxt('a.txt',delimiter='\t',skiprows=0,dtype='str')
for i in range(data.shape[0]):
c=data[i][1]
if c is '':
data=np.delete(arr,row(c,data),axis=0)

--------------------- 
作者:稻穗子 
来源:CSDN 
原文:https://blog.csdn.net/u012135425/article/details/88171185 
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/qq_36387683/article/details/88183463