[SciPy-User] [scipy-user] How to remove a value from an np array?
Fri Jan 27 12:28:38 CST 2012
I have another. First I expose my problem I have datas like that. Is
it possible to create an array with two columns and then do something
to erase the entire line(both time and points) where nan appears?
2012/1/27 David Warde-Farley <email@example.com>:
> On Fri, Jan 27, 2012 at 06:48:45PM +0100, Fabien Lafont wrote:
>> And how can I remove a specific element designated by its position
>> numer? like remove(a) for exemple.
> This is generally not something you want to be doing with NumPy arrays. NumPy
> arrays represent fixed blocks of memory, removing an element means
> reallocating the array and copying values before and after position 8 is the
> only way.
> If a is one-dimensional, then np.concatenate(a[:8], a[9:]) will do the job,
> but if you are going to be frequently performing this kind of operation you
> will get better performance out of a plain Python list.
> SciPy-User mailing list
More information about the SciPy-User