The current np.loadtxt seems to have a slightly weird way to handle max_rows in the presence empty lines (which are ignored). It seems to count the number of actual rows (including empty ones) from the first non-empty one. I.e. \n\n\n\n1,2\n\n3,4 with max_rows=2 reads 1,2. Since it reads at least one row, starts counting from there and then includes the empty-line while counting.