The Matlab function fscanf() seems to be very powerful. Is there any equivalent of the same in python (or numpy)?
Specifically I want to read a matrix from file but I don't want to iterate through each line to read the matrix. Something of this sort (from matlab for reading a 2D 1000x1000 matrix):
matrix = fscanf(fopen('input.txt'),'%d',[1000,1000]);