At 3:14 PM -0700 14/9/00, <dubois(a)users.sourceforge.net> wrote:
>Well, I certainly didn't mean to flame anyone in particular, so I'm sorry
>that Frank was offended.
Publicly apologized, and publicly accepted. I'm sorry I lost my cool.
Ray Beausoleil and I are having a look at this too. He's coming at
the problem from a Windows perspective, and I'm coming at it from a
It's going to be a little slow going for me at first, since it
appears that I'm going to have to get my head around the distutils
way of doing things....
Just in case it saves anyone else following a false lead, yes, there
is a bug in the (Linux Mandrake 7.1; but probably any unix-ish box)
compile line for building the lapack_lite.so shared library (i.e.
what is generated on my box is "-L/usr/lib-llapack" which obviously
is missing a blank before the "-llapack" substring). However, when I
coerced the distutils system to get around that bug (by specifying
"/usr/lib " with a trailing blank for the BLASLIBDIR and LAPACKLIBDIR
variables in setup.py) the same problem (i.e. an "ImportError:
/usr/lib/liblapack.so.3: undefined symbol: e_wsfe" in importing
lapack_lite) ultimately manifested itself. So my advice is not to
bother tracking that one down (although it probably should be
reported as a bug in distutils, since adding that trailing blank
algorithmically instead of in a user modifiable configuration string
is the "right thing to do", TM.).
I'm still puzzled by Thomas Breul's report of preloading an f2c
library squashing the bug under RedHat 6.2(?). That does not work
under Mandrake, although clearly there is some bloody symbol table
missing from somewhere. The trouble is to find out where, and then to
coerce distutils to deal with that in a portable way...
Frank Horowitz frank(a)ned.dem.csiro.au
CSIRO-Exploration & Mining, PO Box 437, Nedlands, WA 6009, AUSTRALIA
Direct: +61 8 9284 8431; FAX: +61 8 9389 1906; Reception: +61 8 9389 8421
i've compiled my own numeric, and i thought i'd offer it
back for other win users. i haven't seen a precompiled
binary package for win32 yet, so maybe this can get
added to sourceforge? if not, here's a link that'll
work for a couple weeks
this is numeric-17.0, compiled for 2.0beta
btw, much thanks and congrats to the numpy team.
getting this compiled and installed was WORLDS
better than working with the 16.x releases. thanks!
I'm writing an extension module that uses PyArrayObjects, and I want to
be able to tell if an array passed in is contiguous.
I know that I can use PyArray_ContiguousFromObject, and it will just
return a reference to the same array if it is contiguous, but I want to
know whether or not a new array has been created. I realize that most of
the time it doesn't matter, but in this case I am chaning the array in
place, and need to pass it to another function that is expecting a
standard C array, so I need to make sure the user has passed in a
I was surprised to not find a "PyArray_Contiguous" function, or
something like it.
I see that there is a field in PyArrayObject (int flags) that has a bit
indicating whether a field is contiguous, but being a newbe to C as
well, I'm not sure how to get at it. I'd love a handy utility function,
but if one doesn't exist, can someone send me the code I need to check
cbarker(a)jps.net --- --- ---
http://www.jps.net/cbarker -----@@ -----@@ -----@@
------@@@ ------@@@ ------@@@
Water Resources Engineering ------ @ ------ @ ------ @
Coastal and Fluvial Hydrodynamics ------- --------- --------
> Can anyone comment on what's happening with arrays of booleans in Numpy?
> I don't want to duplicate someone elses effort, but don't mind standing
> on someone elses shoulders. My application calls for operations on both
> non-sparse and sparce matrices.
"Rich comparisons" are really only syntactic sugar. For non-sparse
matrices the ufuncs greater(a,b) and less(a,b) will do the job.
Equivalents for sparse matrices probably exist.
Hello -- I'm a Numpy Newbie. I have a question for the Numpy gurus about
comparisons of multiarray objects and arrays of booleans in particular.
Back when I was checking out Numpy for an application, I read a note in the
Ascher/Dubois/Hinsen/Hugunin/Oliphant manual about comparisons of multiarray
objects. It said and still says:
"Currently, comparisons of multiarray objects results in exceptions,
since reasonable results (arrays of booleans) are not doable without
non-trivial changes to the Python core. These changes are planned for
Python 1.6, at which point array object comparisons will be updated."
( http://numpy.sourceforge.net/numdoc/HTML/numdoc.html )
Can anyone comment on what's happening with arrays of booleans in Numpy?
I don't want to duplicate someone elses effort, but don't mind standing
on someone elses shoulders. My application calls for operations on both
non-sparse and sparce matrices.
I have image data stored in a 3D array. the code is pretty
simple, but what i don't like about it is needing to transpose
the array twice. here's the code...
def map_rgb_array(surf, a):
"returns an array of 2d mapped pixels from a 3d array"
#image info needed to convert map rgb data
loss = surf.get_losses[:3]
shift = surf.get_shifts()[:3]
prep = a >> loss << shift
once i get to the 'prep' line, my 3d image has all the
values for R,G,B mapped to the appropriate bitspace.
all i need to do is bitwise_or the values together
"finalcolor = R|G|B". this is where my lack of guru-ness
with numpy comes in. the only way i could figure to do
this was transpose the array and then apply the bitwise_or.
only problem is then i need to de-transpose the array to
get it back to where i started. is there some form or mix
of bitwise_or i can use to make it operate on the 3rd
axis instead of the 1st?
thanks all, hopefully this can be improved. legibility
comes second to speed as a priority :]
... hmm, tinkering time passes ...
i did find this, "prep[:,:,0] | prep[:,:,1] | prep[:,:,2]".
is something like that going to be best?
"bitwise_or.reduce((prep[:,:,0], prep[:,:,1], prep[:,:,2]))"
I have recently upgraded to Python 1.6 (final). Now I can't figure out how
to build Numpy with lapack_lite under windows. There is not a makefile for
lapack_lite for MSVC and the instructions in README don't really help. All
that setup.py will do is complain that lapack_lite is not installed.
Specifically, are there specific compiler flags that I need to use to
compile lapack lite? Should I just emulate the unix version and do
cl -c *.c
lib -out:blas.lib blas_lite.obj
lib -out:lapack.lib dlapack_lite.obj f2c_lite.obj zlapack_lite.obj
I tried doing this, but when I try to run the NumTut examples, I get the
Python 1.6 (#0, Sep 5 2000, 08:16:13) [MSC 32 bit (Intel)] on win32
Copyright (c) 1995-2000 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved.
>>> import NumTut
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "NumTut\__init__.py", line 14, in ?
greece = pickle.load(open(os.path.join(_dir, 'greece.pik'), 'rb')) / 256.0
File "D:\Programming\python\Python 1.6\lib\pickle.py", line 855, in load
File "D:\Programming\python\Python 1.6\lib\pickle.py", line 515, in load
File "D:\Programming\python\Python 1.6\lib\pickle.py", line 688, in
klass = self.find_class(module, name)
File "D:\Programming\python\Python 1.6\lib\pickle.py", line 698, in
raise SystemError, \
from module Numericto import class array_constructor
FWIW, I am using the versions from
Numerical, checked out as of Sept. 14. I didn't see any tags defined in the
repository corresponding to release 16.x. Did I miss something? Should the
releases not be getting tagged in the CVS repository?
Thanks for any pointers,
Great job on the new put function. I can't wait to try it out. This goes
a long way towards eliminating one of the few complaints I've heard about
Numerical Python when compared to other similar environments.