>-Original Message-
>From: Tutor [mailto:tutor-bounces+crk=godblessthe...@python.org] On
>Behalf Of Dave Angel
>Sent: Wednesday, October 29, 2014 5:30 AM
>To: tutor@python.org
>Subject: Re: [Tutor] Would somebody kindly...
>
>"Clayton Kirkwood" Wrote in message:
>>
>>
>> !-Original M
On Wed, Oct 29, 2014 at 05:08:28PM +0100, jarod...@libero.it wrote:
> Dear All,
>
> I have a long matrix where I have the samples (1to n) and then I have (1to j
> )elements.
> I would like to count how many times each j element are present on each
> samples.
Jarod, looking at your email addres
On 29/10/14 16:08, jarod...@libero.it wrote:
I have a long matrix where I have the samples (1to n) and then I have
(1to j )elements.
I would like to count how many times each j element are present on each
samples.
That probably makes sense to you but it doesn't to me.
Lets assuyme you have n=
jarod...@libero.it wrote:
> Dear All,
>
> I have a long matrix where I have the samples (1to n) and then I have (1to
> j )elements.
> I would like to count how many times each j element are present on each
> samples.
>
> So the question is which is the best algoritm for obtain the results. The
Dear All,
I have a long matrix where I have the samples (1to n) and then I have (1to j
)elements.
I would like to count how many times each j element are present on each
samples.
So the question is which is the best algoritm for obtain the results. The
result I want is a table like that.
A
"Clayton Kirkwood" Wrote in message:
>
>
> !-Original Message-
> !From: Tutor [mailto:tutor-bounces+crk=godblessthe...@python.org] On
> !Behalf Of Dave Angel
> !Sent: Tuesday, October 28, 2014 6:34 PM
> !To: tutor@python.org
> !Subject: Re: [Tutor] Would somebody kindly...
> !
> !
> !>
>
On Tue, Oct 28, 2014 at 04:13:19PM -0700, Clayton Kirkwood wrote:
> Explain this double speak(>:
>
> [pair for pair in values if key == pair[0]]
Translated to a regular for-loop:
result = []
for pair in values:
if key == pair[0]:
result.append(pair)
It iterates over the sequence `v
On 29/10/14 04:33, Clayton Kirkwood wrote:
!If we'd wanted the new list to contain double the original values we'd
!write:
!
! [ pair*2 for pair in values if key == pair[0] ]
Ok, I am somewhat confused again. In the original example up above, it
appears that the pair list or tuple gets overri
On 28Oct2014 21:33, Clayton Kirkwood wrote:
!If we'd wanted the new list to contain double the original values we'd
!write:
!
! [ pair*2 for pair in values if key == pair[0] ]
Ok, I am somewhat confused again. In the original example up above, it
appears that the pair list or tuple gets overr
On 28Oct2014 21:33, Clayton Kirkwood wrote:
!From: Cameron Simpson [mailto:c...@zip.com.au]
!Let me try a less wordy diagram. You will need to be displaying in a
!constant width font :-)
!
! [ pair for pair in values if key == pair[0] ]
! -- the expression that accrues in the resulting
10 matches
Mail list logo