I'm trying to delete a line from a .xyz file through numpy.delete () command, but is not working.
below is a part of the code problem. The code works without giving any error but the line is not deleted.
Thank you!
import numpy
import os
####################################################
a = numpy.loadtxt("0000_seg.xyz")
max_xyz = a.max(axis=0)
min_xyz = a.min(axis=0)
print max_xyz
print min_xyz
####################################################
ponto = numpy.loadtxt("0000_poucos.xyz")
####################################################
arquivos = os.listdir('/home/caye/Documentos/python/pontos')
print 'tamanho antes'
print len(ponto)
for arquivo in arquivos:
try:
for i in range(0,len(ponto)):
for j in range(3):
if ponto[i,j] > max_xyz[j]:
print 'del max'
numpy.delete(ponto, i)
if ponto[i,j] < min_xyz[j]:
print 'del min'
numpy.delete(ponto, i)
except:
pass
print 'tamanho depois'
print len(ponto)
try:except:passis dangerous. It can hide all kinds of unexpected errors. What kind of error are you trying to capture or pass?