Re: [Numpy-discussion] Choosing between NumPy and SciPy functions

2014-10-31 Thread D. Michael McFarland
Stefan van der Walt ste...@sun.ac.za writes:

 On 2014-10-27 15:26:58, D. Michael McFarland dm...@dmmcf.net wrote:
 What I would like to ask about is the situation this illustrates, where
 both NumPy and SciPy provide similar functionality (sometimes identical,
 to judge by the documentation).  Is there some guidance on which is to
 be preferred?

 I'm not sure if you've received an answer to your question so far. My
 advice: use the SciPy functions.  SciPy is often built on more extensive
 Fortran libraries not available during NumPy compilation, and I am not
 aware of any cases where a function in NumPy is faster or more extensive
 than the equivalent in SciPy.

The whole thread has been interesting reading (now that I've finally
come back to it...got busy for a few days), but this is the sort of
answer I was hoping for.  Thank you.

Best,
Michael
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Choosing between NumPy and SciPy functions

2014-10-27 Thread D. Michael McFarland
A recent post raised a question about differences in results obtained
with numpy.linalg.eigh() and scipy.linalg.eigh(), documented at
http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.eigh.html#numpy.linalg.eigh
and
http://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.eigh.html#scipy.linalg.eigh,
respectively.  It is clear that these functions address different
mathematical problems (among other things, the SciPy routine can solve
the generalized as well as standard eigenproblems); I am not concerned
here with numerical differences in the results for problems both should
be able to solve (the author of the original post received useful
replies in that thread).

What I would like to ask about is the situation this illustrates, where
both NumPy and SciPy provide similar functionality (sometimes identical,
to judge by the documentation).  Is there some guidance on which is to
be preferred?  I could argue that using only NumPy when possible avoids
unnecessary dependence on SciPy in some code, or that using SciPy
consistently makes for a single interface and so is less error prone.
Is there a rule of thumb for cases where SciPy names shadow NumPy names?

I've used Python for a long time, but have only recently returned to
doing serious numerical work with it.  The tools are very much improved,
but sometimes, like now, I feel I'm missing the obvious.  I would
appreciate pointers to any relevant documentation, or just a summary of
conventional wisdom on the topic.

Regards,
Michael
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion