[Deb-scipy-devel] Bug#412703: Masked Array's filled() value doesn't return a numpy array

Enrico Zini enrico at debian.org
Tue Feb 27 15:03:04 CET 2007


Package: python-numpy
Version: 1:1.0.1-1
Severity: minor

Hello,

When a Masked Array wants to give a normal array, it doesn't seem to
produce numpy arrays, but something else:

   $ python
   Python 2.4.4 (#2, Jan 13 2007, 18:15:24)
   [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import MA, numpy
   >>> a = MA.array([1,2,3,4,5])
   >>> a.filled().ravel()
   Traceback (most recent call last):
     File "<stdin>", line 1, in ?
   AttributeError: ravel
   >>> b = numpy.array([1,2,3,4,5])
   >>> b.ravel()
   array([1, 2, 3, 4, 5])
   >>>

Of course I can get a numpy array out of a.filled():

   >>> numpy.array(a.filled()).ravel()
   array([1, 2, 3, 4, 5])

but this makes it very hard to explain (and to understand) what is an
'array' for Python/Numpy and how it's supposed to behave.


Ciao,

Enrico


-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.20.1enrico
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)

Versions of packages python-numpy depends on:
ii  lapack3 [liblapack.so.3] 3.0.20000531a-6 library of linear algebra routines
ii  libc6                    2.3.6.ds1-11    GNU C Library: Shared libraries
ii  libg2c0                  1:3.4.6-5       Runtime library for GNU Fortran 77
ii  libgcc1                  1:4.1.1-21      GCC support library
ii  python                   2.4.4-2         An interactive high-level object-o
ii  python-central           0.5.12          register and build utility for Pyt
ii  refblas3 [libblas.so.3]  1.2-8           Basic Linear Algebra Subroutines 3

python-numpy recommends no packages.

-- no debconf information




More information about the Deb-scipy-devel mailing list