[Numpy-discussion] simple manipulations of numpy arrays

Francesc Alted francesc@continuum...
Fri Feb 10 09:50:54 CST 2012


On Feb 10, 2012, at 3:29 PM, Brad Reisfeld wrote:

> Hi,
> 
> I am relatively new to numpy and am seeking some advice on an
> appropriate way to do the following simple task.
> 
> The idea is to build a class that will allow a user to easily remove
> and keep columns and rows in a 2D numpy array.
<clip>

Apart from the good suggestions already made, you may also find useful the carray package available in:

https://github.com/FrancescAlted/carry

It implements a ctable object that has different capabilities:

* Allows addition and removal of columns very efficiently
* Allows to enlarge and shrink the ctable
* Supports compression (via the fast blosc compressor)
* If numexpr is installed, you can seamlessly operate with columns efficiently
* You can efficiently select rows using complex conditions (needs numexpr too)

You can have a quick look at how this works in the second part of the tutorial:

https://github.com/FrancescAlted/carray/blob/master/doc/tutorial.rst

Hope it helps,

-- Francesc Alted





More information about the NumPy-Discussion mailing list