Date: 26/08/2013 11:34:52
From: The Rev Dodgson
ID: 378536
Subject: Matlab vs Octave vs Python vs R vs ...

This probably isn’t the best place to ask, but still maybe I’ll get some response without a load of GNU evangelism.

I’m looking into using Octave, which apparently does most of what Matlab does, and some things that Matlab doesn’t, at infinitely less cost, but reading various discussion venues I’m seeing quite a few people suggesting Python or R as good alternatives.

Any comments from anyone who has used any of these.

Any other alternatives I should be considering?

Reply Quote

Date: 26/08/2013 12:01:45
From: diddly-squat
ID: 378549
Subject: re: Matlab vs Octave vs Python vs R vs ...

The Rev Dodgson said:


This probably isn’t the best place to ask, but still maybe I’ll get some response without a load of GNU evangelism.

I’m looking into using Octave, which apparently does most of what Matlab does, and some things that Matlab doesn’t, at infinitely less cost, but reading various discussion venues I’m seeing quite a few people suggesting Python or R as good alternatives.

Any comments from anyone who has used any of these.

Any other alternatives I should be considering?

This is a question for PM2Ring but I think the answer is mostly going to involve personal preference and/or any skills overlap between what you use now and any proposed future system.

From what I can see Python is cool in that it is far less verbose than C based languages and R seems to be strong in terms statistical or graphical analysis so I guess it’s a horses for courses type thing.

Reply Quote

Date: 26/08/2013 12:07:56
From: The Rev Dodgson
ID: 378555
Subject: re: Matlab vs Octave vs Python vs R vs ...

diddly-squat said:

This is a question for PM2Ring but I think the answer is mostly going to involve personal preference and/or any skills overlap between what you use now and any proposed future system.

From what I can see Python is cool in that it is far less verbose than C based languages and R seems to be strong in terms statistical or graphical analysis so I guess it’s a horses for courses type thing.

From my brief looks at R, it’s looked pretty hard (and probably not what I really need anyway, being stats oriented).

I think maybe I’ll give Python another look, if only because there seem to be at least some people in the Python community who don’t regard E***l as being a dirty word.

Reply Quote

Date: 26/08/2013 12:17:34
From: diddly-squat
ID: 378561
Subject: re: Matlab vs Octave vs Python vs R vs ...

The Rev Dodgson said:


diddly-squat said:

This is a question for PM2Ring but I think the answer is mostly going to involve personal preference and/or any skills overlap between what you use now and any proposed future system.

From what I can see Python is cool in that it is far less verbose than C based languages and R seems to be strong in terms statistical or graphical analysis so I guess it’s a horses for courses type thing.

From my brief looks at R, it’s looked pretty hard (and probably not what I really need anyway, being stats oriented).

I think maybe I’ll give Python another look, if only because there seem to be at least some people in the Python community who don’t regard E***l as being a dirty word.

Python is a far more generalised language in that the code base hasn’t been specifically designed for implementation in a particular application space.

Reply Quote

Date: 26/08/2013 12:35:37
From: Dropbear
ID: 378572
Subject: re: Matlab vs Octave vs Python vs R vs ...

I have a PDF called “A Primer on Scientific Programming with Python” if anyone is interested..

Reply Quote

Date: 26/08/2013 12:49:19
From: The Rev Dodgson
ID: 378578
Subject: re: Matlab vs Octave vs Python vs R vs ...

Dropbear said:


I have a PDF called “A Primer on Scientific Programming with Python” if anyone is interested..

Just downloaded it :)

Reply Quote

Date: 26/08/2013 15:38:37
From: PM 2Ring
ID: 378683
Subject: re: Matlab vs Octave vs Python vs R vs ...

The Rev Dodgson said:


This probably isn’t the best place to ask, but still maybe I’ll get some response without a load of GNU evangelism.

I’m looking into using Octave, which apparently does most of what Matlab does, and some things that Matlab doesn’t, at infinitely less cost, but reading various discussion venues I’m seeing quite a few people suggesting Python or R as good alternatives.

Any comments from anyone who has used any of these.

Any other alternatives I should be considering?

Sorry, I’ve never used Matlab, Octave, or R, so I can’t really compare them. And I expect that I don’t need Python to do a lot of the stuff that you want it for. But I still recommend Python, primarily for this reason:

diddly-squat said:


Python is a far more generalised language in that the code base hasn’t been specifically designed for implementation in a particular application space.

Python is a general-purpose language with a reputation for being relatively easy to learn and fun to use, with an enthusiastic and helpful community of users. If you have a problem when writing a Python program, whether you’re a novice or a more experienced Python user, it’s not hard to get assistance from the community or to find useful information in the archives of various forums.

The standard Python installation comes with a large number of useful modules (library packages) to extend the core functionality, and it’s easy to install extra 3rd party modules. For example, I use mpmath for arbitrary precision arithmetic and fancy mathematical functions. And I use GTK (via pygtk for fancy GUI creation (GTK & pygtk is often pre-installed on Linux systems). For scientific and engineering work, SciPy is quite popular.

Python is a modern object-oriented language, and that can be a bit daunting at first if you’re previous programming experience is with traditional procedural languages. However, object-oriented programming in Python is a lot less daunting than it is in some other OO languages, like C++. Of course, it’s quite possible to write powerful code in Python without delving deeply into the world of OOP, but you will need to use OO stuff to utilise a lot of the modules mentioned above.

When you first start to learn Python, it’s a good idea to focus on the core of the language, and not to worry much about modules until you are confident with the basics. And when you do start to explore the standard modules there’s certainly no need to master them all! The tutorial in the standard documentation ends with a brief tour of the standard library, which gives a nice overview of what’s available, and once you gain some familiarity with Python you can often guess what a module is for just from its name.

So even though the standard package comes with a huge number of potentially useful functions, you don’t need to learn about them all to be a good Python programmer. The modular design means that each module is relatively self-contained, and you can just learn about a module when you need it. And then forget the details until next time. :)

Reply Quote

Date: 26/08/2013 17:27:07
From: Wocky
ID: 378764
Subject: re: Matlab vs Octave vs Python vs R vs ...

I’ve used all of these packages – I was, in fact, required to learn to use Matlab for my engineering degree. Since I don’t know what your application is, though, Rev, I can’t really give you any advice on which you should use.

R is intended as a FOS replacement for S, and as such is a statistics package. It’s very good at what it does, but what it does is quite limited. See http://en.wikipedia.org/wiki/R_ and http://en.wikipedia.org/wiki/S_

Python is a general purpose programming language. It’s fairly easy to learn and use, and is quite powerful, although there are some things about it that I personally don’t like. It’s also FOSS. See http://en.wikipedia.org/wiki/Python_

Matlab is a matrix workshop. It has an extensive library of plug-ins, and is useful for all kinds of analysis. It’s also possible to produce 2-D and 3-D graphs. It’s a commercial product, and is quite expensive, although there is a pretty large worldwide user community who publish extensive free expansion modules (“m files”) See http://en.wikipedia.org/wiki/Matlab

Octave is a FOS version of Matlab. It also has an extensive library of plug-ins, and can be extended by C and C++ programs. It’s also capable of producing good-quality 2-D and 3-D graphs through external graphing packages. There’s a good user community, and they also publish expansion modules, both C/C++ and m files. Most of the m-files written for Matlab also work on Octave, but sometimes a little tweaking is necessary. See http://en.wikipedia.org/wiki/GNU_Octave

Depending on your application, you might also find the programming language J useful. It’s the successor to APL, and intended as a language for manipulating matrices. Where APL required non-ASCII keyboards and codes, J has been specifically designed (by the same designer) to use ASCII codes. See http://en.wikipedia.org/wiki/J_

Reply Quote

Date: 26/08/2013 20:32:20
From: The Rev Dodgson
ID: 378969
Subject: re: Matlab vs Octave vs Python vs R vs ...

Wocky said:

Since I don’t know what your application is, though, Rev, I can’t really give you any advice on which you for should use.

Really I’m looking for alternatives for what I currently do in Excel, which is:

- Engineering analysis and design calculations ranging from simple to moderately complex.
- Preparing input and analysing output for a finite element analysis program.

I’m actually not convinced that the alternatives will do the job any better than Excel, but I want to have a look because:
1) Maybe I’ll find they are better when I get to know them.
2) They (Matlab in particular) seem to have more credibility in the engineering community than Excel, which seems to be widely regarded as a toy application (by people who don’t really know what you can do with it).
3) Maybe Excel will fall in heap some time, like Lotus 123 did in the late 90’s.

I think I’ll give R a miss, and I didn’t much like the sound of J when I looked it up.

I might try Octave and Python in tandem and see how I go.

(Or alternatively I might get too busy with stuff that actually produces an income and forget about it for another couple of years).

Reply Quote

Date: 26/08/2013 20:57:24
From: PM 2Ring
ID: 378990
Subject: re: Matlab vs Octave vs Python vs R vs ...

The Rev Dodgson said:


2) They (Matlab in particular) seem to have more credibility in the engineering community than Excel, which seems to be widely regarded as a toy application (by people who don’t really know what you can do with it).
3) Maybe Excel will fall in heap some time, like Lotus 123 did in the late 90’s.

I don’t think you need to worry about that too much, and anyway, there are Open Source alternatives. OTOH, reliance on VBA may be a bit of a worry.

One problem with Excel is its limited numeric precision. Most of the time, it’s probably not an issue, but it can lead to errors in some situations. FWIW, Excel’s precision is roughly the same as that of the standard double precision floating-point arithmetic available in most modern languages.

Wiki says

As with other spreadsheets, Microsoft Excel works only to limited accuracy because it retains only a certain number of figures to describe numbers (it has limited precision). Excel nominally works with 8-byte numbers by default, a modified 1985 version of the IEEE 754 specification (Besides numbers, Excel uses a few other data types.) Although Excel can display 30 decimal points, its precision for a specified number is confined to 15 significant figures, and calculations may have an accuracy that is even less due to three issues: round off, truncation, and binary storage.

The simple way around that limitation is to use a language that provides numeric data types with greater precision. As I mentioned above, in Python I use mpmath for that purpose, which can give you as much precision as your computer’s memory can cope with, although of course there’s a speed penalty for higher precision arithmetic.

When doing stuff in Excel, you’re used to manipulating one or more columns of data essentially simultaneously. Python provides a couple of efficient data structures (lists and tuples) that let you do almost the same thing. List operations can be very fast – with large lists they may be significantly than equivalent code written using a more traditional looping algorithm. Python has a handy function called zip() which allows you to join together multiple lists (into a list of tuples) so you can operate on a bunch of lists conveniently.

The core Python does not provide a native matrix type, but that’s generally not much of a problem because lists of lists (etc) are fairly easy to work with. But if you do want traditional matrices, there are packages that provide them, along with efficient implementations of the usual matrix operations.

Reply Quote

Date: 27/08/2013 09:14:08
From: The Rev Dodgson
ID: 379234
Subject: re: Matlab vs Octave vs Python vs R vs ...

PM 2Ring said:


I don’t think you need to worry about that too much, and anyway, there are Open Source alternatives. OTOH, reliance on VBA may be a bit of a worry.

But almost everything I do has VBA in it. Not that VBA is going to disappear any time soon, but it may well be a development dead end (much like Lotus 123, which still has an active discussion forum, but has finally been dumped by IBM just this year).

PM 2Ring said:


One problem with Excel is its limited numeric precision. Most of the time, it’s probably not an issue, but it can lead to errors in some situations. FWIW, Excel’s precision is roughly the same as that of the standard double precision floating-point arithmetic available in most modern languages.

I really don’t see the 15 SF precision as being a problem; certainly not an Excel-specific problem, since the programs I use it with also operate to the same precision (as do Matlab and Octave). There is arbitrary precision arithmetic available for Excel anyway (search XNumbers if interested).

PM 2Ring said:


When doing stuff in Excel, you’re used to manipulating one or more columns of data essentially simultaneously. Python provides a couple of efficient data structures (lists and tuples) that let you do almost the same thing. List operations can be very fast – with large lists they may be significantly than equivalent code written using a more traditional looping algorithm. Python has a handy function called zip() which allows you to join together multiple lists (into a list of tuples) so you can operate on a bunch of lists conveniently.

I don’t do a lot of “on-sheet” processing; anything other than very simple stuff is done in VBA or in the programs I link to.

PM 2Ring said:


The core Python does not provide a native matrix type, but that’s generally not much of a problem because lists of lists (etc) are fairly easy to work with. But if you do want traditional matrices, there are packages that provide them, along with efficient implementations of the usual matrix operations.

I’ve now discovered NumPY and SciPY which it seems are intended to provide Matlab functionality (without in any way being Matlab “clones”). I think these, in conjunction with Pyxll and PYWin, are likely to sway my choice in the Python direction, rather than Octave.

Reply Quote

Date: 27/08/2013 09:39:56
From: The Rev Dodgson
ID: 379253
Subject: re: Matlab vs Octave vs Python vs R vs ...

Just had a look at this video:
Pyxll on Youtube

I think this may well be just what I’m looking for.

Also downloading:
Enthought

Reply Quote

Date: 27/08/2013 09:43:53
From: Arts
ID: 379258
Subject: re: Matlab vs Octave vs Python vs R vs ...

Under the Environment Ministry’s new policy, fishermen now found with hauls including detached fins risk up to seven years in prison for hunting an endangered species since identifying species by fins alone is difficult.

Read more: http://www.news.com.au/world-news/india-bans-shark-finning-to-protect-endangered-species/story-fndir2ev-1226704653299#ixzz2d7bTXJo5

yay

Reply Quote

Date: 27/08/2013 09:45:35
From: The Rev Dodgson
ID: 379259
Subject: re: Matlab vs Octave vs Python vs R vs ...

Arts said:


Under the Environment Ministry’s new policy, fishermen now found with hauls including detached fins risk up to seven years in prison for hunting an endangered species since identifying species by fins alone is difficult.

Read more: http://www.news.com.au/world-news/india-bans-shark-finning-to-protect-endangered-species/story-fndir2ev-1226704653299#ixzz2d7bTXJo5

yay

Thanks for the warning, but is this a feature of Python or Octave?

Reply Quote

Date: 27/08/2013 09:45:54
From: Arts
ID: 379261
Subject: re: Matlab vs Octave vs Python vs R vs ...

sorry wrong thread

Reply Quote