[Numpy-discussion] Have a problem: what is attribute 'compress'
Sebastian Haase
haase at msg.ucsf.edu
Wed Dec 18 17:23:05 CST 2002
Hi!
Somehow I have a problem with numarray. Please take a look at this:
>>>import numarray as na
>>>na.array([0, 0])
array([0, 0])
>>>na.array([0.0, 0.0])
Traceback (most recent call last):
File "<input>", line 1, in ?
File "C:\Python22\Lib\site-packages\numarray\numarray.py", line 581, in
__repr__
MAX_LINE_WIDTH, PRECISION, SUPPRESS_SMALL, ', ', 1)
File "C:\Python22\Lib\site-packages\numarray\arrayprint.py", line 163, in
array2string
separator, array_output)
File "C:\Python22\Lib\site-packages\numarray\arrayprint.py", line 125, in
_array2string
format, item_length = _floatFormat(data, precision, suppress_small)
File "C:\Python22\Lib\site-packages\numarray\arrayprint.py", line 246, in
_floatFormat
non_zero = numarray.abs(numarray.compress(numarray.not_equal(data, 0),
data))
AttributeError: 'module' object has no attribute 'compress'
The same workes fine with Numeric. But I would prefer numarray because I'm
writing C++-extensions and I need "unsigned shorts".
What is this error about?
Thanks,
Sebastian
More information about the Numpy-discussion
mailing list