Comments on: Replacing Mathematica with Python http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/ The blog of John D. Cook Sat, 11 Feb 2012 22:42:11 -0500 http://wordpress.org/?v=2.8.4 hourly 1 By: Stuart http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-53311 Stuart Mon, 29 Nov 2010 11:28:34 +0000 http://www.johndcook.com/blog/?p=5827#comment-53311 For symbolic computation you might take a glance at Racket, which is a dialect of Lisp. (It grew out of a very mature implementation of Scheme.) http://racket-lang.org/ As far as the syntax differences go, it really depends on how you used Mathematica. I tended to tackle problems from a functional perspective and so my Mathematica expressions were reminiscent of the Lisp style - the only differences being that function application looked like F[...] instead of (F ...). For symbolic computation you might take a glance at Racket, which is a dialect of Lisp. (It grew out of a very mature implementation of Scheme.)

http://racket-lang.org/

As far as the syntax differences go, it really depends on how you used Mathematica. I tended to tackle problems from a functional perspective and so my Mathematica expressions were reminiscent of the Lisp style – the only differences being that function application looked like F[...] instead of (F …).

]]>
By: John http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-53267 John Mon, 29 Nov 2010 01:59:42 +0000 http://www.johndcook.com/blog/?p=5827#comment-53267 Yaroslav: I still use Mathematica regularly, especially for symbolic computation. But I do use Python for more tasks than I used to. I like that Mathematica's syntax is very memorable. I can just fire it up and get down to business without having to look anything up. It's convenient for quick calculations. If I needed to do extensive programming, I'd rather use Python. Yaroslav: I still use Mathematica regularly, especially for symbolic computation. But I do use Python for more tasks than I used to.

I like that Mathematica’s syntax is very memorable. I can just fire it up and get down to business without having to look anything up. It’s convenient for quick calculations. If I needed to do extensive programming, I’d rather use Python.

]]>
By: Yaroslav Bulatov http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-53264 Yaroslav Bulatov Mon, 29 Nov 2010 01:22:08 +0000 http://www.johndcook.com/blog/?p=5827#comment-53264 So, it's been almost half a year, what's the verdict? So, it’s been almost half a year, what’s the verdict?

]]>
By: Beetle B. http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41827 Beetle B. Sat, 17 Jul 2010 05:32:45 +0000 http://www.johndcook.com/blog/?p=5827#comment-41827 I really like NumPy/SciPy, etc. But regarding SymPy, are you sure it's good enough? I know I looked at it some months ago and ruled it out for what I was trying to do (or maybe I just couldn't do what I needed due to unfamiliarity). I've compiled various versions of Sage on my Linux box over the years. It wasn't at all difficult - however it does take hours to compile. As for their disregard for Windows, perhaps they were careless in phrasing. They probably meant that their developers are Linux developers, and don't know much about Windows. Likely they want a Windows version, but need developers familiar with Windows, and few/none have signed up. That's a common problem with many open source projects (and it's not their fault). Also, knowing how Sage is built, it'd be a *major* challenge to get it running on Windows. It basically has custom versions of many large Linux projects within it. Some distributions don't like it for that reason (redundancy). So to get it working on Windows, you have to port those other projects to Windows as well. I really like NumPy/SciPy, etc. But regarding SymPy, are you sure it’s good enough? I know I looked at it some months ago and ruled it out for what I was trying to do (or maybe I just couldn’t do what I needed due to unfamiliarity).

I’ve compiled various versions of Sage on my Linux box over the years. It wasn’t at all difficult – however it does take hours to compile.

As for their disregard for Windows, perhaps they were careless in phrasing. They probably meant that their developers are Linux developers, and don’t know much about Windows. Likely they want a Windows version, but need developers familiar with Windows, and few/none have signed up. That’s a common problem with many open source projects (and it’s not their fault).

Also, knowing how Sage is built, it’d be a *major* challenge to get it running on Windows. It basically has custom versions of many large Linux projects within it. Some distributions don’t like it for that reason (redundancy). So to get it working on Windows, you have to port those other projects to Windows as well.

]]>
By: M. Edward (Ed) Borasky http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41595 M. Edward (Ed) Borasky Mon, 12 Jul 2010 08:08:38 +0000 http://www.johndcook.com/blog/?p=5827#comment-41595 I played around with Sage but it's way too powerful for most everything I do. And I have never learned Python - I know Perl, R and Ruby. I've used Maxima but found it hard to use until I got the wxMaxima GUI version. But for general numerical computing, I'm perfectly happy with R. I played around with Sage but it’s way too powerful for most everything I do. And I have never learned Python – I know Perl, R and Ruby.

I’ve used Maxima but found it hard to use until I got the wxMaxima GUI version. But for general numerical computing, I’m perfectly happy with R.

]]>
By: Andrew http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41491 Andrew Sat, 10 Jul 2010 04:43:09 +0000 http://www.johndcook.com/blog/?p=5827#comment-41491 I see Sage has been mentioned. There is also the Enthought distribution of Python which is specifically aimed at computational science needs. A second option is the Python(x,y) distribution. It is a huge set of tools for Python (though you can customize it as needed) and comes with the Spyder terminal (used to be pydee). Spyder gives an interactive terminal much like MatLab. I see Sage has been mentioned. There is also the Enthought distribution of Python which is specifically aimed at computational science needs. A second option is the Python(x,y) distribution. It is a huge set of tools for Python (though you can customize it as needed) and comes with the Spyder terminal (used to be pydee). Spyder gives an interactive terminal much like MatLab.

]]>
By: alfC http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41483 alfC Sat, 10 Jul 2010 01:32:21 +0000 http://www.johndcook.com/blog/?p=5827#comment-41483 Lately I stopped using mathematica because of the vendor lockin and because mathematica took too much control of the problem solution. And replaced it with C++ and libraries usable from C++ for numerical work, for the symbolic part I realized that in general I needed it less that I though. Lately I stopped using mathematica because of the vendor lockin and because mathematica took too much control of the problem solution. And replaced it with C++ and libraries usable from C++ for numerical work, for the symbolic part I realized that in general I needed it less that I though.

]]>
By: Ram Rachum http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41447 Ram Rachum Fri, 09 Jul 2010 17:16:07 +0000 http://www.johndcook.com/blog/?p=5827#comment-41447 The nice thing about Mathematica is that it Just Works, and that all the tools from different fields are consolidated into one program, with consistent naming conventions. Not so for Python scientific tools; I wish they will move in this direction too. If I understand correctly, Sage is trying to do it too, but I think that their disregard for normal, non-technical people is their big problem. I spoke to them and they <a href="http://groups.google.com/group/sage-devel/msg/8fe91b9941befe1d?hl=en" rel="nofollow">pretty much said</a> that they care mostly about Linux users because most of the developers of Sage are on Linux. I personally hate this attitude... There are so many scientists on Windows and in my opinion anyone who ignores Windows will end up in obscurity. The nice thing about Mathematica is that it Just Works, and that all the tools from different fields are consolidated into one program, with consistent naming conventions. Not so for Python scientific tools; I wish they will move in this direction too.

If I understand correctly, Sage is trying to do it too, but I think that their disregard for normal, non-technical people is their big problem. I spoke to them and they pretty much said that they care mostly about Linux users because most of the developers of Sage are on Linux. I personally hate this attitude… There are so many scientists on Windows and in my opinion anyone who ignores Windows will end up in obscurity.

]]>
By: Pete Hunt http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41443 Pete Hunt Fri, 09 Jul 2010 16:31:41 +0000 http://www.johndcook.com/blog/?p=5827#comment-41443 +1 for Sage. Though you need to run it in a VM on Windows, I've found it trivial to install on Ubuntu 9 and 10 as well as Mac OS X 10.6. +1 for Sage. Though you need to run it in a VM on Windows, I’ve found it trivial to install on Ubuntu 9 and 10 as well as Mac OS X 10.6.

]]>
By: Hector http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41437 Hector Fri, 09 Jul 2010 15:30:53 +0000 http://www.johndcook.com/blog/?p=5827#comment-41437 Lets not forget <a href="http://www.sagemath.org/" rel="nofollow">Sage</a>: a full-blown Python-based Computer Algebra System. Lets not forget Sage: a full-blown Python-based Computer Algebra System.

]]>
By: Tweets that mention Replacing Mathematica with Python — The Endeavour -- Topsy.com http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41433 Tweets that mention Replacing Mathematica with Python — The Endeavour -- Topsy.com Fri, 09 Jul 2010 15:05:21 +0000 http://www.johndcook.com/blog/?p=5827#comment-41433 [...] This post was mentioned on Twitter by John D. Cook. John D. Cook said: New post: Replacing Mathematica with Python http://bit.ly/baOGXb #scipy [...] [...] This post was mentioned on Twitter by John D. Cook. John D. Cook said: New post: Replacing Mathematica with Python http://bit.ly/baOGXb #scipy [...]

]]>
By: Daniel Black http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41432 Daniel Black Fri, 09 Jul 2010 14:56:16 +0000 http://www.johndcook.com/blog/?p=5827#comment-41432 @Alasdair, you beat me to the punch. Additionally, though I haven't used it, I know that you can access Mathematica from within Sage, if for some reason there were a Mathematica function you needed or preferred. @Alasdair, you beat me to the punch. Additionally, though I haven’t used it, I know that you can access Mathematica from within Sage, if for some reason there were a Mathematica function you needed or preferred.

]]>
By: John http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41430 John Fri, 09 Jul 2010 14:42:37 +0000 http://www.johndcook.com/blog/?p=5827#comment-41430 Alasdair: I've heard good things about SAGE. However, you can't install it on Windows, and I've heard people say you can hardly install it on Linux: the best thing is to download a virtual machine with SAGE installed. When I looked briefly at Maxima, the syntax looked awkward compared to Mathematica. Maybe it's just a matter of familiarity. I'm sure Maxima is quite powerful. Alasdair: I’ve heard good things about SAGE. However, you can’t install it on Windows, and I’ve heard people say you can hardly install it on Linux: the best thing is to download a virtual machine with SAGE installed.

When I looked briefly at Maxima, the syntax looked awkward compared to Mathematica. Maybe it’s just a matter of familiarity. I’m sure Maxima is quite powerful.

]]>
By: Alasdair http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41429 Alasdair Fri, 09 Jul 2010 14:36:22 +0000 http://www.johndcook.com/blog/?p=5827#comment-41429 ...and if you use Sage (http://www.sagemath.org) you get an amazingly powerful CAS which is based on Python, so all your Python knowledge gets carried across. Sage actually contains Maxima (as well as lots of other open-source mathematical software) within it. …and if you use Sage (http://www.sagemath.org) you get an amazingly powerful CAS which is based on Python, so all your Python knowledge gets carried across. Sage actually contains Maxima (as well as lots of other open-source mathematical software) within it.

]]>
By: John http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41427 John Fri, 09 Jul 2010 14:34:11 +0000 http://www.johndcook.com/blog/?p=5827#comment-41427 Daniel: I've felt the vendor lock-in. I've used Mathematica off and on for two decades. It's a great piece of software. How could I ever learn something else as well? But it looks like it's not as hard as I thought. Daniel: I’ve felt the vendor lock-in. I’ve used Mathematica off and on for two decades. It’s a great piece of software. How could I ever learn something else as well? But it looks like it’s not as hard as I thought.

]]>
By: Pat http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41425 Pat Fri, 09 Jul 2010 14:25:35 +0000 http://www.johndcook.com/blog/?p=5827#comment-41425 Another open source symbolics package is GiNaC</a>. This is actually a C++ library but there are Python bindings available via the <a href="http://pyginac.sourceforge.net/" rel="nofollow">PyGiNaC</a> package. Another open source symbolics package is GiNaC. This is actually a C++ library but there are Python bindings available via the PyGiNaC package.

]]>
By: Daniel Lemire http://www.johndcook.com/blog/2010/07/09/replacing-mathematica-with-python/comment-page-1/#comment-41424 Daniel Lemire Fri, 09 Jul 2010 14:17:16 +0000 http://www.johndcook.com/blog/?p=5827#comment-41424 There is the little fact that these commercial tools (Mathematica, Maple, Matlab) tend to do some vendor lock-in. The more you invest in one particular tool, the more you have an incentive to continue. That's a risky proposition on the long run. I have promoted Python as an alternative to Matlab for a long time now. I had not realized we could use it as an alternative to Mathematica, but why not? While it is slightly off-topic, Maxima is an excellent open source symbolic tool: http://maxima.sourceforge.net/ I have used Maxima, for serious work, in two research papers. Once in 2002 and once this year. I had maxima crunching polynomials for days a few months ago. It works well. It is not as smart as Mathematica or Maple, but good enough for my needs. There is a nice GUI which is very Maple-like. There is the little fact that these commercial tools (Mathematica, Maple, Matlab) tend to do some vendor lock-in. The more you invest in one particular tool, the more you have an incentive to continue. That’s a risky proposition on the long run.

I have promoted Python as an alternative to Matlab for a long time now. I had not realized we could use it as an alternative to Mathematica, but why not?

While it is slightly off-topic, Maxima is an excellent open source symbolic tool: http://maxima.sourceforge.net/

I have used Maxima, for serious work, in two research papers. Once in 2002 and once this year. I had maxima crunching polynomials for days a few months ago. It works well. It is not as smart as Mathematica or Maple, but good enough for my needs. There is a nice GUI which is very Maple-like.

]]>