Hello,
I have an array that I know will need to grow to X elements. However, I
will need to work with it before it's completely filled. I see two ways
of doing this:
bigarray = np.empty(X)
current_size = 0
for i in something:
buf = produce_data(i)
Gerrit Holl gerrit.h...@gmail.com writes:
On 31 October 2010 17:10, Nikolaus Rath nikol...@rath.org wrote:
Hello,
I have a couple of numpy arrays which belong together. Unfortunately
they have different dimensions, so I can't bundle them into a higher
dimensional array.
My solution
Hello,
I have a couple of numpy arrays which belong together. Unfortunately
they have different dimensions, so I can't bundle them into a higher
dimensional array.
My solution was to put them into a Python list instead. But
unfortunately this makes it impossible to use any ufuncs.
Has someone
Hello,
I want to find the first i such that x[i] y and x[i+1] = y. Is there
a way to do this without using a Python loop?
I can't use np.searchsorted(), because my x array crosses y several
times.
Best,
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP
Lane Brooks l...@brooks.nu writes:
On 08/17/2010 09:53 AM, Nikolaus Rath wrote:
Hello,
I want to find the first i such that x[i] y and x[i+1]= y. Is there
a way to do this without using a Python loop?
I can't use np.searchsorted(), because my x array crosses y several
times.
Best
Warren Weckesser warren.weckes...@enthought.com writes:
Nikolaus Rath wrote:
Hello,
I want to find the first i such that x[i] y and x[i+1] = y. Is there
a way to do this without using a Python loop?
I can't use np.searchsorted(), because my x array crosses y several
times.
In [34
Robert Kern robert.k...@gmail.com writes:
Overloading '*' and '**' while convenient does have consequences. It
would be nice if we could have a few more infix operators in Python to
allow separation of element-by-element calculations and dot-product
calculations.
eat e.antero.ta...@gmail.com writes:
How do I best find out the indices of the largest x elements in an
array?
Just
a= np.asarray([[1, 8, 2], [2, 1, 3]])
print np.where((a.T== a.max(axis= 1)).T)
However, if any row contains more than 1 max entity, above will fail. Please
let me to know
Keith Goodman kwgood...@gmail.com writes:
On Wed, Apr 14, 2010 at 12:39 PM, Nikolaus Rath nikol...@rath.org wrote:
Keith Goodman kwgood...@gmail.com writes:
On Wed, Apr 14, 2010 at 8:49 AM, Keith Goodman kwgood...@gmail.com wrote:
On Wed, Apr 14, 2010 at 8:16 AM, Nikolaus Rath nikol
eat e.antero.ta...@gmail.com writes:
Nikolaus Rath Nikolaus at rath.org writes:
[snip]
Not quite, because I'm interested in the n largest values over all
elements, not the largest element in each row or column. But Keith's
solution seems to work fine, even though I'm still struggling
Hello,
How do I best find out the indices of the largest x elements in an
array?
Example:
a = [ [1,8,2], [2,1,3] ]
magic_function(a, 2) == [ (0,1), (1,2) ]
Since the largest 2 elements are at positions (0,1) and (1,2).
Best,
-Niko
--
»Time flies like an arrow, fruit flies like a
Keith Goodman kwgood...@gmail.com writes:
On Wed, Apr 14, 2010 at 8:49 AM, Keith Goodman kwgood...@gmail.com wrote:
On Wed, Apr 14, 2010 at 8:16 AM, Nikolaus Rath nikol...@rath.org wrote:
Hello,
How do I best find out the indices of the largest x elements in an
array?
Example
12 matches
Mail list logo