diff -r 2763b87dd7e8 -r 0660c8b8409e numpy/lib/npyio.py
--- a/numpy/lib/npyio.py	Fri Mar 25 22:37:19 2011 -0600
+++ b/numpy/lib/npyio.py	Sat Mar 26 11:51:28 2011 +0100
@@ -579,7 +579,8 @@
 
 
 def loadtxt(fname, dtype=float, comments='#', delimiter=None,
-            converters=None, skiprows=0, usecols=None, unpack=False):
+            converters=None, skiprows=0, numrows=None, usecols=None,
+            unpack=False):
     """
     Load data from a text file.
 
@@ -609,6 +610,9 @@
         ``converters = {3: lambda s: float(s or 0)}``.  Default: None.
     skiprows : int, optional
         Skip the first `skiprows` lines; default: 0.
+    numrows : int, optional
+        Read only `numrows` lines; The default, None, results in all rows
+        being read.
     usecols : sequence, optional
         Which columns to read, with 0 being the first.  For example,
         ``usecols = (1,4,5)`` will extract the 2nd, 5th and 6th columns.
@@ -771,7 +775,10 @@
             converters[i] = conv
 
         # Parse each line, including the first
-        for i, line in enumerate(itertools.chain([first_line], fh)):
+        all_lines = itertools.chain([first_line], fh)
+        if not (numrows is None):
+            all_lines = all_lines[: numrows]
+        for i, line in enumerate(all_lines):
             vals = split_line(line)
             if len(vals) == 0:
                 continue
