[Numpy-discussion] Removing masked arrays for 1.7? (Was 1.7 blockers)

Drew Frank ajfrank@ics.uci....
Fri Apr 20 17:16:02 CDT 2012


On Fri, Apr 20, 2012 at 11:45 AM, Chris Barker <chris.barker@noaa.gov> wrote:
>
> On Fri, Apr 20, 2012 at 11:39 AM, Dag Sverre Seljebotn
> <d.s.seljebotn@astro.uio.no> wrote:
> > Oh, right. I was thinking "small" as in "fits in L2 cache", not small as
> > in a few dozen entries.

Another example of a small array use-case: I've been using numpy for
my research in multi-target tracking, which involves something like a
bunch of entangled hidden markov models. I represent target states
with small 2d arrays (e.g. 2x2, 4x4, ..) and observations with small
1d arrays (1 or 2 elements). It may be possible to combine a bunch of
these small arrays into a single larger array and use indexing to
extract views, but it is much cleaner and more intuitive to use
separate, small arrays. It's also convenient to use numpy arrays
rather than a custom class because I use the linear algebra
functionality as well as integration with other libraries (e.g.
matplotlib).

I also work with approximate probabilistic inference in graphical
models (belief propagation, etc), which is another area where it can
be nice to work with many small arrays.

In any case, I just wanted to chime in with my small bit of evidence
for people wanting to use numpy for work with small arrays, even if
they are currently pretty slow. If there were a special version of a
numpy array that would be faster for cases like this, I would
definitely make use of it.

Drew


More information about the NumPy-Discussion mailing list