Re: [Numpy-discussion] numpy.append & numpy.where vs list.append and brute iterative for loop

2011-01-27 Thread Dewald Pieterse
On Thu, Jan 27, 2011 at 4:33 PM, Dewald Pieterse wrote: > > > On Thu, Jan 27, 2011 at 4:19 PM, Christopher Barker > wrote: > >> On 1/27/11 1:03 PM, Dewald Pieterse wrote: >> >>> I am processing two csv files against another, my first implementation >>&

Re: [Numpy-discussion] numpy.append & numpy.where vs list.append and brute iterative for loop

2011-01-27 Thread Dewald Pieterse
On Thu, Jan 27, 2011 at 4:19 PM, Christopher Barker wrote: > On 1/27/11 1:03 PM, Dewald Pieterse wrote: > >> I am processing two csv files against another, my first implementation >> used python list of lists and list.append to generate a new list while >> looping all th

[Numpy-discussion] numpy.append & numpy.where vs list.append and brute iterative for loop

2011-01-27 Thread Dewald Pieterse
pe_drawing]]) > NI_data_list_new = numpy.append(NI_data_list_new, > piperow, 0) > #Rewrite NI_data to new list > if NIroom == '': > NI_data_list_new = numpy.append(NI_data_list_new,[NI_row],0) > > print (time.clock()-starttime) > some relevant o

Re: [Numpy-discussion] Stacking a 2d array onto a 3d array

2010-10-26 Thread Dewald Pieterse
I see my slicing was the problem, np.vstack((test[:1], test)) works perfectly. On Wed, Oct 27, 2010 at 12:55 AM, wrote: > On Tue, Oct 26, 2010 at 8:15 PM, Dewald Pieterse > wrote: > > Starting with: > > > >> In [93]: test = > >> numpy.array([[[1,1,1],[1,1,1

[Numpy-discussion] Stacking a 2d array onto a 3d array

2010-10-26 Thread Dewald Pieterse
> 2 > 3 > 4 > 5 > > /usr/lib64/python2.6/site-packages/numpy/core/shape_base.py in vstack(tup) > 212 > 213 """ > --> 214 return _nx.concatenate(map(atleast_2d,tup),0) &g

Re: [Numpy-discussion] Count occurrences in a nested ndarray

2010-10-20 Thread Dewald Pieterse
On Wed, Oct 20, 2010 at 1:32 AM, Lutz Maibaum wrote: > On Oct 19, 2010, at 6:09 PM, Dewald Pieterse wrote: > > for xiter in range(xindex): > > for yiter in range(yindex): > > if edges[xiter,yiter,:] == [255,0,0]: > > groenpix

[Numpy-discussion] Count occurrences in a nested ndarray

2010-10-19 Thread Dewald Pieterse
] == [0,255,0]: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() WARNING: Failure executing file: What am I doing wrong? Thanx -- Dewald Pieterse ___ NumPy-Discussion mailing list NumPy-Discuss