[Tutor] tab separated file handling
Niharika Jakhar
niharika1883 at gmail.com
Wed Jun 13 06:03:08 EDT 2018
hi everyone!
I am working with a tsv file which has NA and empty values.
I have used csv package to make a list of list of the data.
I want to remove NA and empty values.
This is what I wrote:
#removes row with NA values
for rows in self.dataline:
for i in rows:
if i == 'NA' or i == '':
self.dataline.remove(rows)
This is what the terminal says:
self.dataline.remove(rows)
ValueError: list.remove(x): x not in list
This is how the file looks like:
d23 87 9 NA 67 5 657 NA 76 8 87 78 90 800
er 21 8 908 9008 9 7 5 46 3 5 757 7 5
More information about the Tutor
mailing list