Mathematica vs Matlab vs Python
Mathematica vs Matlab vs Python http://www.larssono.com/musings/matmatpy/index.html -- ----------------------------------------------------------------------- | Alan K. Jackson | To see a World in a Grain of Sand | | alan@ajackson.org | And a Heaven in a Wild Flower, | | www.ajackson.org | Hold Infinity in the palm of your hand | | Houston, Texas | And Eternity in an hour. - Blake | -----------------------------------------------------------------------
Tue, 07 Jul 2009 21:30:06 -0500, alan kirjoitti:
Mathematica vs Matlab vs Python
The Python code there is not very idiomatic Numpy code. It's written for Numeric, and fancy indexing etc. are not used. Seems like the author also left it as an exercise for the reader to implement the data file parser in Matlab. I doubt it can be easily done in 20 lines :) -- Pauli Virtanen
On 8-Jul-09, at 4:19 AM, Pauli Virtanen wrote:
Tue, 07 Jul 2009 21:30:06 -0500, alan kirjoitti:
Mathematica vs Matlab vs Python
The Python code there is not very idiomatic Numpy code. It's written for Numeric, and fancy indexing etc. are not used.
Seems like the author also left it as an exercise for the reader to implement the data file parser in Matlab. I doubt it can be easily done in 20 lines :)
Yup. It's not even very idiomatic Python. readlines() is probably a bad idea unless your file is trivial length, and even ignoring numpy.loadtxt(), all of this could be considerably simplified with the built-in csv module. David
On Wed, Jul 08, 2009 at 12:48:17PM -0700, Matthew Brett wrote:
Yup. It's not even very idiomatic Python. readlines() is probably a bad idea unless your file is trivial length, and even ignoring numpy.loadtxt(), all of this could be considerably simplified with the built-in csv module.
or a 1-liner with scipy.io.loadmat ...
No crack! Some dude built a matlab reader for Python. Crazy man! Gaël
2009/7/8 Gael Varoquaux
On Wed, Jul 08, 2009 at 12:48:17PM -0700, Matthew Brett wrote:
Yup. It's not even very idiomatic Python. readlines() is probably a bad idea unless your file is trivial length, and even ignoring numpy.loadtxt(), all of this could be considerably simplified with the built-in csv module.
or a 1-liner with scipy.io.loadmat ...
No crack! Some dude built a matlab reader for Python. Crazy man!
Not even a Frenchman would be that crazy. Must've been a Brit...
participants (6)
-
alan@ajackson.org
-
David Warde-Farley
-
Gael Varoquaux
-
Matthew Brett
-
Pauli Virtanen
-
Stéfan van der Walt