On 06/13/2018 01:37 AM, Peter Otten wrote: > Slater, Joseph C. wrote: > >> Dear friends,
as others have said, I'll also say: your problem statement is fuzzy. if your data looks like this: > 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 is it meaningful that there are 14 items in a "row"? or is the row still valid if you remove some items from it? That is, does the position in the row matter? If it does, then you should replace NA by some value Python can recognize - for example None - instead of trying to delete the element. tab-separated is a pretty poor choice of data format if fields can be blank - you can't spot blanks easily, unless you're fortunate enough that each "column" can be displayed in less than a tab-width so it always lines up. that's a human problem, not a computer problem, but could impede your ability to visually inspect that things look sane. Using a non-whitespace separator character would be better. or... is this just a list of values and there is really no row concept? In that case, don't bring rows into it, and drop the invalid entries on reading. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor