[SciPy-user] How to start with SciPy and NumPy
Gael Varoquaux
gael.varoquaux@normalesup....
Sat Jan 24 16:32:37 CST 2009
On Sat, Jan 24, 2009 at 06:31:26PM +0100, Vicent wrote:
> For example, what is the difference between "random" from random module
> and "random" from numpy.random? Or are they the same?
Well, if you look at the number of distributions included in numpy.random
and random, this will give you a clue. In addition to shipping much more
distributions, numpy.random, just like al numpy, and scipy, works with
arrays, rather than numbers, which allows you to vectorize part of the
code (check out
http://en.wikipedia.org/wiki/Vectorization_(computer_science)
and
http://en.wikipedia.org/wiki/Array_programming
You seem to believe that working with large chunk of numbers organized
in arrays is useful only for linear algebra, but on the opposite,
avoiding loops and working on arrays is the basis of a whole catagory of
very succesful language such as Matlab, or IDL. Many old-class numerical
developper despise these languages, but they have proven to be effective.
> Before I thought that working with NumPy+SciPy would be mandatory for me,
> and so that I should have to adapt my code to all its special features,
> from the beggining. But, at this moment, my strategy would be working with
> "plain" Python, and when necessary, look for features I need in NumPy and
> SciPy. Is it OK?
Wel, you can choose to do scientific computing without using the major
scientific libraries. You can do this in Python like in any other
language. You have 15 years of scientific computing in Python to
reinvent, and even more if you extend to other languages. I would advise
you to use them, until you can insight on how they are organized, and why
people ike them. Once you know them well, you can choose to do without,
but at least your choice will be made on an educated basis. I,
personnaly, think it would be foolish to do numerical work in Python
without numpy.
Yes, documentation showing the big picture is missing. The problem is
that nobody seems to have time to write it. Maybe it is because it
doesn't bring money, or academic credit in. We all need to survive.
I reckon from your name that you might be speaking French. It which case,
I just happen to have spent time writting a 12 page article trying to
give the big picture on this problem:
http://www.gnulinuxmag.com/index.php/2009/01/23/gnulinux-magazine-hs-n°40-janvierfevrier-2009-chez-votre-marchand-de-journaux
By the way, for the non French-speaking people on this list, I will write
an English version, but give me time. This one cost me a lot of week ends
in the past 2 years.
Gaël
More information about the SciPy-user
mailing list