> Date: Tue, 30 Oct 2001 14:58:38 -0500
> From: "Edward C. Jones" <edcjones(a)erols.com>
> To: numpy-discussion(a)lists.sourceforge.net
> Subject: [Numpy-discussion] Numeric2
>
> What is the current status of Numeric2?
>
We are in the process of putting it up on sourceforge now.
While you can actually download it from there now, I would
strongly recommend waiting until we put some more current
and up-to-date documentation about it there as well. We
will announce it on this mailing list when it is ready
(within a week?). But it isn't called Numeric2 any longer.
We've called it numarray and it will be found under
"python arrays" on Sourceforge.
Perry Greenfield

The following Python program:
import Numeric, LinearAlgebra
a = Numeric.identity(5)
v, s, wt = LinearAlgebra.singular_value_decomposition(a)
gave the following error:
Traceback (most recent call last):
File "./silly.py", line 3, in ?
import Numeric, LinearAlgebra
File "/usr/lib/python2.2/site-packages/Numeric/LinearAlgebra.py", line
8, in ? import lapack_lite
ImportError: /usr/lib/python2.2/site-packages/Numeric/lapack_lite.so:
undefined symbol: dgesdd_
When I installed Numeric-20.2.0, I changed Setup.py to:
# delete all but the first one in this list if using your own LAPACK/BLAS
sourcelist = ['Src/lapack_litemodule.c',]
# set these to use your own BLAS
library_dirs_list = ['usr/lib']
libraries_list = ['/usr/lib/libblas.so', '/usr/lib/liblapack.so']
What is the problem?
Thanks,
Ed Jones

Hi,
Let us assume that
r = rank(C) < N (1)
where C is a symmetric NxN matrix. This implies that the number
of non-zero eigenvalues of C is r. Because C is a symmetric
matrix there exists an orthogonal matrix U whose columns are
the eigenvectors of C such that
U^\top C U = [ d , O
O , O]. (2)
In the above equation d \in rxr is a diagonal matrix consisting
of only the non-zero eigenvalues of C.
For convenience, partition U as
U = [U_1 | U_2] (3)
where the columns of U_1 (Nxr) are the eigenvectors corresponding to the
non-zero block
d and the columns of U_2 are the eigenvectors corresponding to the rest
(N-r) number
of zero eigenvalues.
Defining a rectangular transformation matrix
R = U_1 (4)
it is easy to show that
R^\top C R = d. (5)
Therefore, the matrix R in equation (4) transforms the originally rank
deficient
matrix C to a full-rank (diagonal) matrix of rank r.
I am looking for an efficient Numpy implementation of this
transformation.
Thanks in advance
Nils Wagner

Hey numpy people!
Do you know the better way to compute with numpy:
r**M
where r is a positive real and M a 2x2 (rank 2) matrix, symmetric or not,
with real or not eigenvalues.
Help or comment are appreciated,
Jean-Bernard

I am using Numeric 20.2.0. I have found the following
inconsistency. I am not a python guru and have no idea how I
would fix it myself.
The following code creates a series of arrays of data, and then
applies maximum.reduce to the array to get the largest value. It then
prints the type of returned max value.
Most of the returns are typed as an array with a shape of (). If the
array is created as a type of 'l' (long) or 'd' (double), the return type
is not array. This seems wrong. Can someone tell me if this is
expected, and if not, where would I look to change/fix it.
--- CODE ---
from Numeric import *
print "++++"
for tc in ('b', 'i', 'l', 's', 'f', 'd'):
smallArray = array([1,2,3,4], tc)
amax = maximum.reduce(smallArray)
print smallArray.typecode(), smallArray, "Max:", amax,
type(amax)
if type(amax) == type(smallArray):
print amax.shape
--- OUTPUT ---
>>>> ++++
b [1 2 3 4] Max: 4 <type 'array'>
()
i [1 2 3 4] Max: 4 <type 'array'>
()
l [1 2 3 4] Max: 4 <type 'int'>
s [1 2 3 4] Max: 4 <type 'array'>
()
f [ 1. 2. 3. 4.] Max: 4.0 <type 'array'>
()
d [ 1. 2. 3. 4.] Max: 4.0 <type 'float'>

No, I just have a major release coming up of cdat (cdat.sf.net) so I've
been busy.
-----Original Message-----
From: nobody [mailto:nobody@sourceforge.net] On Behalf Of Alessandro
MIRONE
Sent: Tuesday, October 16, 2001 2:22 AM
To: paul(a)pfdubois.com
Subject: activity on NumPy
Hi,
I have noticed that that developer activity
has almost stopped ( bugs and patches are no more processed) after 11/9.
Did you get some restriction at your lab? Best regards
Alessandro Mirone

Greetings,
I am trying to pickle an array of objects with a typecode of Object.
Ultimately this array will be in a class I create based on UserArray,
but the following illustrates a problem I am having. See code at the
end of the message.
I am working in Windows 2000, Service Pack 1, using PythonWin,
win32all build 140. I am using the following versions of python stuff
Python: 2.1.1 (#20, Jul 20 2001, 01:19:29) [MSC 32 bit (Intel)]
Numeric: 20.2.0
cPickle: 1.71
I create a simple array with a type of Object, pickle it to a file using
cPickle. I then run this script in PythonWin. I can unpickle this file
from PythonWin, but not from DOS window. Alternatively, I can
pickle the array from DOS, and unpickle it from DOS, but not from
PythonWin. If I save both versions of the file and compare them,
they are the same size, but not the same bytes. This does not
happen with other types for the array.
When unpickling, I get a GPF, either from PythonWin.exe or
Python.exe.
Any ideas?
My ultimate goal is to be able to store simple class objects in the
array and be able to pickle and unpickle them.
----- CODE ----
# simple test for pickling problem
import Numeric
import cPickle
import sys
basePath = "c:\\python21\\scripts\\pickle\\"
print "++++++"
# create a simple array of object, populated by integer data
ds1 = Numeric.array([1,2,3,4], 'O')
print ds1, ds1.typecode()
print "Python: ", sys.version
print "Numeric: " , Numeric.__version__
print "cPickle: ", cPickle.__version__
pickle = 1 # change to 0 to skip the pickling step
for ii in (range(1,2)):
if pickle:
fileName = "%s%s%d%s" % (basePath, "simple", ii, ".pck")
print "pickling ", fileName
fp = open(fileName, 'wb')
cPickle.dump(ds1, fp, 1)
fp.close()
for ii in range(1,2):
fileName = "%s%s%d%s" % (basePath, "simple", ii, ".pck")
print "unpickling ", fileName
fp = open(fileName, 'rb')
obj = cPickle.load(fp)
fp.close()
print obj, obj.typecode()

The Numpy version of modulo uses a different sign convention for
negative arguments than does Python itself:
>>> -5 % 3
1
>>> array((-5,-5)) % 3
array([-2, -2])
(Numpy version 20.2.0, Python version 1.5.2 and version 2.2a4.)
Is there a reason for this (hard to imagine), or is this a bug?
Eric

Hi,
I'm the coordinator for the PythonCard project, which is at:
http://pythoncard.sourceforge.net/
PythonCard provides a GUI framework for building Python applications. The
project is relatively new, but there are a large number of sample
applications, including a number of drawing and visualization samples.
PythonCard already supports loading and drawing of common formats like XBM,
GIF, JPEG, PNG, etc. from disk files.
Last month I started a BitmapCanvas for the framework to simplify
interactive drawing. Rather than duplicate all of the functionality of the
Python Imaging Library (PIL) or the various plotting packages already
available, I want to make it easy to display results created with other
drawing packages and numPy in PythonCard. To that end, the Bitmap and
BitmapCanvas class already support PIL. You can convert a PIL RGB image
to/from a PythonCard bitmap and you can draw a PIL RGB image in a
BitmapCanvas at a given x, y location. If you're already converting from
numPy to PIL, you should be able to show your results in PythonCard today. I
will be making a related post about this on the image-sig.
Anyway, what I would like to do is provide similar methods to make it easy
to convert numPy arrays to images or a bitmap to numPy without having to go
to PIL first. I don't currently use numPy since I don't do any scientific
computing (and my math skills are pretty pathetic) and most of my programs
are text or database-oriented, so I'm relying on others to spec out the
features they need or want. Eventually, I would like to add some visual
effects to PythonCard such as wipes and fades which would be a perfect use
of arrays. I want to make sure that PythonCard provides a good GUI framework
for the scientific community. I would appreciate any suggestions, pointers
to related resources, etc.
PythonCard currently sits on top of wxPython, so if you are already working
with numPy and wxPython I would be very interested to hear about it. If you
would like to get more actively involved, please join the PythonCard mailing
list, which is probably a better place for longer-term discussions than the
numPy list.
http://lists.sourceforge.net/lists/listinfo/pythoncard-users
Thanks,
ka
---
Kevin Altis
altis(a)semi-retired.com