El jeu., 18-11-2010 a las 20:19 +0530, Venkat escribió: > I have many files to convert like this. All of them are having file > names like 0, 1, 2, ....500. with out any extension. > Actually, I renamed actual files so that I can import them in Matlab > for batch processing. Since Matlab also new for me, I thought I will > try Numpy first. > Can any body help me in writing the script to do this for making batch > processing.
One point that others did not answer is the 'batch' part. If your files are named sequentially, you can 'template' the argument you pass to the loader function. For example, if you load with numpy.loadtxt your data that is stored in files named 'mydata0', 'mydata1', .... 'mydata511', your batch processing may look like that for ind in xrange(512): filename = 'mydata%d' % ind data = numpy.loadtxt(filename, ... ) #... your processing on single file with adapted range of indices (see xrange doc), string formatting (see string doc) and arguments to loader function -- Fabrice Silva _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion