Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread Olivier Delalleau
m impossible. >>> I have tried what you just sent but it won't just work. >>> You could confirm this. >>> Sent from my BlackBerry wireless device from MTN >>> >>> -Original Message- >>> From: Olivier Delalleau >>> Sender: num

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread DIPO ELEGBEDE
t;> Sent from my BlackBerry wireless device from MTN >> >> -Original Message- >> From: Olivier Delalleau >> Sender: numpy-discussion-boun...@scipy.org >> Date: Tue, 20 Sep 2011 12:00:51 >> To: Discussion

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread Olivier Delalleau
cipy.org > Date: Tue, 20 Sep 2011 12:00:51 > To: Discussion of Numerical Python > Reply-To: Discussion of Numerical Python > Subject: Re: [Numpy-discussion] Dealing with arrays > > ___ > NumPy-Discussion mailing list > NumPy-Discuss

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread dipo . elegbede
--Original Message- From: Olivier Delalleau Sender: numpy-discussion-boun...@scipy.org Date: Tue, 20 Sep 2011 12:00:51 To: Discussion of Numerical Python Reply-To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] Dealing with arrays ___

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread Olivier Delalleau
2011/9/20 DIPO ELEGBEDE > 3. Get each array one after the other and work with it. (This is where the > problem is). > > How can I fetch out array1, then array2 then array3 up to array12? > > Is it possible to slice? > > Not really sure what your problem is, but since you should have now a list of

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread DIPO ELEGBEDE
gt;> Sent from my BlackBerry wireless device from MTN >> >> -Original Message- >> From: josef.p...@gmail.com >> Sender: numpy-discussion-boun...@scipy.org >> Date: Tue, 20 Sep 2011 10:11:42 >> To: Discussion of Numerical Python >> Reply-To: Discussio

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread Olivier Delalleau
Discussion of Numerical Python > Reply-To: Discussion of Numerical Python > Subject: Re: [Numpy-discussion] Dealing with arrays > > ___ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.or

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread G Jones
> > -Original Message- > From: josef.p...@gmail.com > Sender: numpy-discussion-boun...@scipy.org > Date: Tue, 20 Sep 2011 10:11:42 > To: Discussion of Numerical Python > Reply-To: Discussion of Numerical Python > Subject: Re: [Numpy-discussion] Dealing with arr

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread dipo . elegbede
discussion-boun...@scipy.org Date: Tue, 20 Sep 2011 10:11:42 To: Discussion of Numerical Python Reply-To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] Dealing with arrays On Tue, Sep 20, 2011 at 10:06 AM, wrote: > Hi Chico, my list needs to be converted to a numpy array first

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread josef . pktd
011 11:00:08 > To: Discussion of Numerical Python > Reply-To: Discussion of Numerical Python > Subject: Re: [Numpy-discussion] Dealing with arrays > > What about: > >>>> listoflists = [[1,1,1], [1,2,3], [2,2,2]] >>>> for eachlist in listoflists: > ...     prin

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread G Jones
08 > To: Discussion of Numerical Python > Reply-To: Discussion of Numerical Python > Subject: Re: [Numpy-discussion] Dealing with arrays > > What about: > > >>> listoflists = [[1,1,1], [1,2,3], [2,2,2]] > >>> for eachlist in listoflists: > ...

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread dipo . elegbede
-discussion] Dealing with arrays What about: >>> listoflists = [[1,1,1], [1,2,3], [2,2,2]] >>> for eachlist in listoflists: ... print eachlist.count(1), eachlist.count(2), eachlist.count(3) ... 3 0 0 1 1 1 0 3 0 >>> Chico > Hi All, > > I am extracting a l

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread chico
What about: >>> listoflists = [[1,1,1], [1,2,3], [2,2,2]] >>> for eachlist in listoflists: ... print eachlist.count(1), eachlist.count(2), eachlist.count(3) ... 3 0 0 1 1 1 0 3 0 >>> Chico > Hi All, > > I am extracting a list of lists from an application. In this case, my list > has 12 lis

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread dipo . elegbede
To: Discussion of Numerical Python Reply-To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] Dealing with arrays ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Dealing with arrays

2011-09-20 Thread Olivier Delalleau
Let's say your "list of lists" is called my_list, and assuming you are using python 2.7+: import collections import numpy for tmp_list in my_list: array = numpy.array(tmp_list) counts = collections.Counter(array) print counts Note that you don't even need to use numpy for that (you ca

[Numpy-discussion] Dealing with arrays

2011-09-20 Thread DIPO ELEGBEDE
Hi All, I am extracting a list of lists from an application. In this case, my list has 12 lists. I then coverted each list into a numpy array. This returns 12 different arrays. Very well. The 12 different arrays are like as follows: [2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 1 2