summaryrefslogtreecommitdiff
path: root/numpy/lib/io.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/io.py')
-rw-r--r--numpy/lib/io.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/lib/io.py b/numpy/lib/io.py
index 93c955942..caa790809 100644
--- a/numpy/lib/io.py
+++ b/numpy/lib/io.py
@@ -378,7 +378,11 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None,
# By preference, use the converters specified by the user
for i, conv in (user_converters or {}).iteritems():
if usecols:
- i = usecols.index(i)
+ try:
+ i = usecols.index(i)
+ except ValueError:
+ # Unused converter specified
+ continue
converters[i] = conv
# Parse each line, including the first