Oh, I see. I'm not sure that a simple option springs to mind.  The `loadtxt` function is a pretty lightweight line reader that I think is implemented in some nearer the metal language than pure Python (C, almost certainly).  We could use the Python file I/O (`open` and `readlines`) to put each line into a list of strings, then work out how many lines are not prefixed with `#` using list comprehension.  We could even assume on top that headers are only at the top of the file to make this faster still.  But I'm not sure it would be faster than `loadtxt`...