ANN: Release of NumPy 0.9.5

T

Travis E. Oliphant

NumPy is the successor to both Numeric and Numarray. It builds from and
uses code from both.

More information can be found at the following links

http://numeric.scipy.org
http://www.scipy.org
http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103

Highlights of Release:

- Unicode arrays are now always UCS4 even on narrow Python builds
- Many improvements and bugfixes to dtype objects
- Improvements to numpy.distutils
- Optimized dot function improved so copies are no longer made for
transposed arrays

- Many more bug-fixes

Full release notes at

http://sourceforge.net/project/shownotes.php?release_id=394206&group_id=1369


Best regards,


-Travis Oliphant
 
T

Thomas Gellekum

Travis E. Oliphant said:
- Improvements to numpy.distutils

Stupid questions: is it really necessary to keep your own copy of
distutils and even install it? What's wrong with the version in the
Python distribution? How can I disable the colorized output to get
something more readable than yellow on white (well, seashell1)?

tg
 
T

Travis E. Oliphant

Thomas said:
Stupid questions: is it really necessary to keep your own copy of
distutils and even install it? What's wrong with the version in the
Python distribution? How can I disable the colorized output to get
something more readable than yellow on white (well, seashell1)?

Yes --- distutils does not provide enough functionality.

Besides, it's not a *copy* of distutils. It's enhancements to
distutils. It builds on top of standard distutils.

I don't know the answer to the colorized output question. Please post
to (e-mail address removed) to get more help and/or make
suggestions.

-Travis
 
V

vinjvinj

I use Numeric extensivly and have been thinking of migrating to Numpy.
I have a couple of questions:

1. Will the speed of creating new arrays, copying new arrays and
slicing new arrays be similar to Numeric?
2. I have some pyrex code that uses Numeric header files. will they be
compatible with numpy?
3. I use they following tow functions from scipy.core: extract, insert.
Are there similar functions in Numpy?

Thanks,

VJ
 
R

Robert Kern

vinjvinj said:
I use Numeric extensivly and have been thinking of migrating to Numpy.
I have a couple of questions:

1. Will the speed of creating new arrays, copying new arrays and
slicing new arrays be similar to Numeric?

Various benchmark comparisons with Numeric and numarray have been done. Check
the archives of the numpy-discussion and scipy-dev lists. Of course, if you're
interested in performance on your problems, you need to time code that's
appropriate to your uses. Since numpy installs alongside Numeric, you should be
able to do this relatively easily.
2. I have some pyrex code that uses Numeric header files. will they be
compatible with numpy?

Yes. Just change the header file from "Numeric/arrayobject.h" to
"numpy/arrayobject.h".
3. I use they following tow functions from scipy.core: extract, insert.
Are there similar functions in Numpy?

Most, if not all, of the functions in scipy_base have been moved into numpy.

In [1]: import numpy

In [2]: numpy.extract?
Type: function
Base Class: <type 'function'>
String Form: <function extract at 0x6e2870>
Namespace: Interactive
File:
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy-0.9.5.2085-py2.4-macosx-10.4-ppc.egg/numpy/lib/function_base.py
Definition: numpy.extract(condition, arr)
Docstring:
Return the elements of ravel(arr) where ravel(condition) is True
(in 1D).

Equivalent to compress(ravel(condition), ravel(arr)).


In [3]: numpy.insert?
Type: function
Base Class: <type 'function'>
String Form: <function insert at 0x6e28b0>
Namespace: Interactive
File:
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy-0.9.5.2085-py2.4-macosx-10.4-ppc.egg/numpy/lib/function_base.py
Definition: numpy.insert(arr, mask, vals)
Docstring:
Similar to putmask arr[mask] = vals but the 1D array vals has the
same number of elements as the non-zero values of mask. Inverse of
extract.

--
Robert Kern
(e-mail address removed)

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
 
V

vinjvinj

I read some of the earlier threads which essentially said that numpy is
about 3-4 times slower then Numeric for smaller arrays. I'm assuming
that applies only to operations that apply to the whole arrays.

I was curious how the performance of the following operations would
compare though:
1. Copying arrays
2. Creating arrays
3. Slicing Arrays

In the mean time I'll install numpy and give it a spin.

That's great. it would be great if I could remove the scipy_base
dependency.

VJ
 
T

Travis E. Oliphant

vinjvinj said:
I read some of the earlier threads which essentially said that numpy is
about 3-4 times slower then Numeric for smaller arrays. I'm assuming
that applies only to operations that apply to the whole arrays.

I was curious how the performance of the following operations would
compare though:
1. Copying arrays
2. Creating arrays
3. Slicing Arrays

It is really hard to say unless you show specific applications:

But, here are some facts.

1) NumPy is in C just like Numeric
2) NumPy is more flexible than Numeric and that means a few more
if-statements and checks which can slow-down array creation and slicing.
3) Some optimizations have been done to remove unnecessary slowness
(e.g. unnecessary checking but more could be done).

4) Ufuncs have more overhead primarily because of

a) the ability to alter how errors are obtained using local /
global variables (these must be looked-up in a dictionary which is most
of the source of any performance penalty),
b) the ability for other objects that can be converted to arrays to
interact with ufuncs so that the original object is returned by the ufuncs
c) the fact that excessive copying is not done in order to
type-cast from one array to annother, this requires some "set-up" overhead

My understanding is that most of the "slow-downs" reported for small
arrays can be attributed to ufuncs, but there will be slower paths
through the C-code for other cases as well because of the increased
flexibility.

Our goal is to be as fast as we can be so give it a spin and tell us how
to improve...

Thanks,

-Travis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top