473,699 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Numarray, numeric, NumPy, scpy_core ??!!

J
Hi

I hope the title of this message indicates my question. I am looking
for basic
array functionality in Python and it turns out that there are all these
packages which
are somehow related. Some are allegedly discontinued but still seem to
get updated. Could we start a discussion about which package will or
may or should survive ?

I started to use numarray, but I have a bug that I just cannot find a
solution for, so I started
to look around again. Basically I want to provide scripting support to
a graphics engine. All the
matrices and vectors are in C++ and all I want to do is provide an
interface to python. As a matter of fact, all of the matrix
multiplication etc, could remain in the native C++ code, but I need a
way to extend the python language with the array data type and somehow
intercept operator calls such as *,+,- ....

How is that done in the current libraries... Thx for any help.
Cheers
Jochen

Jan 21 '06 #1
22 2000
J wrote:
Hi

I hope the title of this message indicates my question. I am looking
for basic
array functionality in Python and it turns out that there are all these
packages which
are somehow related. Some are allegedly discontinued but still seem to
get updated. Could we start a discussion about which package will or
may or should survive ?

I started to use numarray, but I have a bug that I just cannot find a
solution for, so I started
to look around again. Basically I want to provide scripting support to
a graphics engine. All the
matrices and vectors are in C++ and all I want to do is provide an
interface to python. As a matter of fact, all of the matrix
multiplication etc, could remain in the native C++ code, but I need a
way to extend the python language with the array data type and somehow
intercept operator calls such as *,+,- ....

How is that done in the current libraries... Thx for any help.
Cheers
Jochen


I know the pain having similar trouble to understand the dependencies
and what is what and why, so any enlightenment towards getting rid of my
confusion to distinguish what is what and why is highly welcome.

I decided to use numarray, so maybe you can report what your problem/bug
is before I run into it myself? The reason why I decided to use numarray
was, that the whole scpy_core story seems to get more or less commercial
and its free version comes because of this with no documentation of
newest features.

Claudio
Jan 21 '06 #2
J wrote:
Hi

I hope the title of this message indicates my question. I am looking
for basic
array functionality in Python and it turns out that there are all these
packages which
are somehow related. Some are allegedly discontinued but still seem to
get updated. Could we start a discussion about which package will or
may or should survive ?


You missed the discussion. The answer is numpy.

http://numeric.scipy.org/

The mailing list is nu************* *@lists.sourcef orge.net :

http://sourceforge.net/mail/?group_id=1369

--
Robert Kern
ro*********@gma il.com

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

Jan 21 '06 #3
Claudio Grondi wrote:
I decided to use numarray, so maybe you can report what your problem/bug
is before I run into it myself? The reason why I decided to use numarray
was, that the whole scpy_core story seems to get more or less commercial
and its free version comes because of this with no documentation of
newest features.


No, numpy (which used to be scipy_core) is completely free. It will never turn
into a proprietary package.

The complete documentation, however, is currently available only as a PDF for
purchase, but only until a certain number of copies have been sold, or enough
time passes. Believe me, the old manuals for Numeric and numarray were never as
complete. No one could ever commit the time to thoroughly document them for
free. Charging for the documentation (for a limited time) was the only way
Travis Oliphant could afford to spend the time to write the full documentation
and write the code. I think the quality of the book speaks well for that choice.

Of course, the docstring coverage is quite good, and we have explicitly welcomed
efforts to produce free documentation. So far, those who have volunteered
haven't produced anything. And as incomplete as the old Numeric manual was *for
Numeric*, it and the free documentation that is actually distributed with numpy
and describes the differences between the two goes a long way.

--
Robert Kern
ro*********@gma il.com

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

Jan 21 '06 #4
J wrote:
Hi

I hope the title of this message indicates my question. I am looking
for basic
array functionality in Python and it turns out that there are all these
packages which
are somehow related. Some are allegedly discontinued but still seem to
get updated. Could we start a discussion about which package will or
may or should survive ?

I started to use numarray, but I have a bug that I just cannot find a
solution for, so I started
to look around again. Basically I want to provide scripting support to
a graphics engine. All the
matrices and vectors are in C++ and all I want to do is provide an
interface to python. As a matter of fact, all of the matrix
multiplication etc, could remain in the native C++ code, but I need a
way to extend the python language with the array data type and somehow
intercept operator calls such as *,+,- ....

How is that done in the current libraries... Thx for any help.
Cheers
Jochen

numarray was intended to replace Numeric.

numarray is stable and performs reaonably well.
If you have a specific problem, you might post a problem report to:
nu************* *@lists.sourcef orge.net
You can also subscribe to the list.

numpy is intended to perform better and is close to a production release.

Colin W,
Jan 21 '06 #5
J
Ok, I will look at NumPy ...

I have another question about performance. Are the array operations
such as matrix multiplication implemented in
python or in C ? I was under the impression that the function calls in
numarray are only wrappers to C code, but now I suspect that matrix
multiplicaiton is implemented in python and executed in the
interpreter. Is that true ?

Can someone also please point me to examples of how I could make my own
array classes. Basically all I need is vectors and 3x3 matrices. I
already have all of the multiplication code in my C++ classes and only
need wrappers. But how can I create an array class and intercept
operators calls like * + -. This is not neccessarily a solution that I
want to follow, but it may be what
I have to do for now.

BTW, here is also the problem I have with a numarray. I have created a
vector like so...

mPyObject = PyArray_FromDim sAndData(GeoVec 4f::sD,GeoVec4f ::sDim,
PyArray_FLOAT,( char*)mValue.mV alues);
Py_INCREF(mPyOb ject);

The PyObject is then used as a member called "gradient" in another
embedded class. When I execute the following
script

x.gradient*3

my app just crashes. But when I execute

print (x.gradient)
x.gradient*3

everything works fine... I assum there must be some kind of reference
count problem...
Cheers
Jochen

Jan 21 '06 #6
J wrote:
Ok, I will look at NumPy ...

I have another question about performance. Are the array operations
such as matrix multiplication implemented in
python or in C ? I was under the impression that the function calls in
numarray are only wrappers to C code, but now I suspect that matrix
multiplicaiton is implemented in python and executed in the
interpreter. Is that true ?
No, not at all. In fact, if an optimized BLAS is available on your system, you
can make numpy (or numarray or Numeric) use that to do your matrix
multiplications much faster.
Can someone also please point me to examples of how I could make my own
array classes. Basically all I need is vectors and 3x3 matrices. I
already have all of the multiplication code in my C++ classes and only
need wrappers. But how can I create an array class and intercept
operators calls like * + -. This is not neccessarily a solution that I
want to follow, but it may be what
I have to do for now.


It's a difficult problem, since you have to overload nearly every operation in
order to return arrays of your subclass, not the basic array class. numpy has a
new mechanism to try to alleviate this. You should look at the matrix subclass
in numpy/core/defmatrix.py .

--
Robert Kern
ro*********@gma il.com

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

Jan 21 '06 #7
J

I will just jump in an use NumPy. I hope this one will stick and evolve
into the mother of array packages.
How stable is it ? For now I really just need basic linear algebra.
i.e. matrix multiplication, dot, cross etc

Cheers

Jan 21 '06 #8
J wrote:
I will just jump in an use NumPy. I hope this one will stick and evolve
into the mother of array packages.
How stable is it ? For now I really just need basic linear algebra.
i.e. matrix multiplication, dot, cross etc


That stuff isn't going to change on you.

--
Robert Kern
ro*********@gma il.com

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

Jan 21 '06 #9
J wrote:
I will just jump in an use NumPy. I hope this one will stick and evolve
into the mother of array packages.
How stable is it ? For now I really just need basic linear algebra.
i.e. matrix multiplication, dot, cross etc


There is a new release coming out this weekend. It's closer to 1.0 and
so should be more stable. It also has some speed improvements in
matrix-vector operations (if you have ATLAS BLAS --- or if you download
a binary version with ATLAS BLAS compiled in). I would wait for it.

-Travis

Jan 21 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1474
by: Colin J. Williams | last post by:
numarray is a package which is under development and intended to replace Numeric, an efficient and operational package. One of the classes in numarray is NumArray. As currently implemented, instances of this class are instantiated using factory functions. This appears to restrict the sub-classing of NumArray Examples: a sub-class Matrix, an array restricted to two dimensions, or a sub-class Mix, which combines the NumArray with...
2
2949
by: Marc Schellens | last post by:
Following the NumPy documentation, I took over some C code, but run into an error. Does anybody have a suggestion? Thanks, marc gdlpython.cpp:225: `PyArray_Type' undeclared (first use this function) #include <python2.3/Python.h>
11
1985
by: grv | last post by:
So it is supposed to be very fast to have an array of say 5 million integers stored in a binary file and do a = numarray.fromfile('filename', (2, 2, 2)) numarray.add(a, 9, a) but how is that faster than reading the entire file into memory and then having a for loop in C: (loop over range) { *p++ += 9 }
10
2229
by: Bryan | last post by:
hi, what is the difference among numeric, numpy and numarray? i'm going to start using matplotlib soon and i'm not sure which one i should use. this page says, "Numarray is a re-implementation of an older Python array module called Numeric" http://www.stsci.edu/resources/software_hardware/numarray
0
1993
by: robert | last post by:
just a note - some speed comparisons : 0.60627370238398726 0.42836673376223189 0.36965815487747022 0.016557970357098384 0.15692469294117473 0.01951756438393204
4
3374
by: Christian Convey | last post by:
I need to bang out an image processing library (it's schoolwork, so I can't just use an existing one). But I see three libraries competing for my love: numpy, numarray, and numeric. Can anyone recommend which one I should use? If one is considered the officially blessed one going forward, that would be my ideal. Thanks, Christian
0
9174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7750
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.