Alex Rivera | Logout

Using Python to replace MATLAB: how to import data?

Asked 2009-06-29T10:44:24.283
11

I want to use some Python libraries to replace MATLAB. How could I import Excel data in Python (for example using NumPy) to use them?

I don't know if Python is a credible alternative to MATLAB, but I want to try it. Is there a a tutorial?

Edit
Report

1 Answer

3

There are probably hundreds of ways you could import text data into Python.

But since you want to replace MATLAB, you're going be using NumPy and probably SciPy.

Keep things simple: use NumPy's standard text-loading:

import numpy
imported_array = numpy.loadtxt('file.txt',delimiter='\t')  # Assuming tab-delimiter
print imported_array.shape
answered 2009-07-23T18:30:04.407

Your Answer