From a5615d4917a25331e008959c55cb5de16b7d164c Mon Sep 17 00:00:00 2001 From: Robert Kern Date: Wed, 27 Feb 2008 22:56:07 +0000 Subject: Handle the no-comment case correctly. --- numpy/lib/io.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'numpy/lib/io.py') diff --git a/numpy/lib/io.py b/numpy/lib/io.py index aa832487f..dce93af76 100644 --- a/numpy/lib/io.py +++ b/numpy/lib/io.py @@ -293,7 +293,11 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None, for i,line in enumerate(fh): if i 0: + line = line[:comments_start].strip() + else: + line = line.strip() if not len(line): continue vals = line.split(delimiter) if converterseq is None: -- cgit v1.2.1