On Sun, Jul 29, 2012 at 4:29 PM, Peter Otten <__pete...@web.de> wrote:
>
> If you have to sort your data anyway you can sort it first and then apply
> itertools.groupby()...
That was my thinking. I wrote it with groupby (see link below) because
Francesco described field 0 as "in growing order".
h
Il 29/07/2012 03:42, Dave Angel wrote:
On 07/28/2012 07:12 PM, Francesco Loffredo wrote:
You might find it enlightening to look up:
http://www.doughellmann.com/PyMOTW/
which explores the Pythons standard library.
Site promptly visited, PDF downloaded, started reading. It really seems
a
eryksun wrote:
> On Sun, Jul 29, 2012 at 7:21 AM, Peter Otten <__pete...@web.de> wrote:
>>
>> If you don't have to deal with large datasets many of its functions can
>> easily be emulated with lists and loops though. As an example here's the
>> grouping with a plain vanilla dict:
>>
>> groups = {}
On Sun, Jul 29, 2012 at 7:21 AM, Peter Otten <__pete...@web.de> wrote:
>
> If you don't have to deal with large datasets many of its functions can
> easily be emulated with lists and loops though. As an example here's the
> grouping with a plain vanilla dict:
>
> groups = {}
> for item in data:
>
On 29/07/2012 18:32, Alan Gauld wrote:
On 29/07/12 15:21, Mark Lawrence wrote:
Reminds me of the Welsh selectors, two were wise and chose Dai, but
three were foolish and chose Gareth. That should lead to some head
scratching!!!
I'm scratching, but it sounds like a throwback to the 1980's
nat
On 29/07/12 15:21, Mark Lawrence wrote:
Reminds me of the Welsh selectors, two were wise and chose Dai, but
three were foolish and chose Gareth. That should lead to some head
scratching!!!
I'm scratching, but it sounds like a throwback to the 1980's
national rugby team... Dai Jones and Gareth
On 29/07/2012 14:16, Alan Gauld wrote:
On 29/07/12 12:21, Peter Otten wrote:
plenty modules I haven't explored yet - and I must admit itertools
is one that I really should get to grips with...
You're nuts :) Itertools to me is the Swiss Army Knife
If you don't have to deal with large data
On 29/07/12 12:21, Peter Otten wrote:
plenty modules I haven't explored yet - and I must admit itertools
is one that I really should get to grips with...
You're nuts :) Itertools to me is the Swiss Army Knife
If you don't have to deal with large datasets many of its functions can
easily be
Mark Lawrence wrote:
> On 29/07/2012 00:53, Alan Gauld wrote:
>> On 29/07/12 00:12, Francesco Loffredo wrote:
>>
>>> Every time this happens, I have to admit that I'm a newbie and I've
>>> still got a lot to learn about Python. Especially about its wonderful
>>> standard library.
>>
>> Don't worry
On 29/07/2012 00:53, Alan Gauld wrote:
On 29/07/12 00:12, Francesco Loffredo wrote:
Every time this happens, I have to admit that I'm a newbie and I've
still got a lot to learn about Python. Especially about its wonderful
standard library.
Don't worry, I've been using Python for 15 years and
On Sat, Jul 28, 2012 at 7:12 PM, Francesco Loffredo wrote:
>
> My bad, now I'll RTFM again and I will study very carefully the operator and
> itertools modules.
I forgot to mention a gotcha about groupby's implementation. The
grouby object and the yielded _grouper objects share a single
iterator.
On 07/28/2012 07:12 PM, Francesco Loffredo wrote:
> Il 28/07/2012 20:41, eryksun wrote:
>> On Sat, Jul 28, 2012 at 11:12 AM, Francesco Loffredo
>> wrote:
>>> I had to study carefully your present and desired lists, and I
>>> understood
>>> what follows (please, next time explain !):
>>> - each 7-t
On 29/07/12 00:12, Francesco Loffredo wrote:
Every time this happens, I have to admit that I'm a newbie and I've
still got a lot to learn about Python. Especially about its wonderful
standard library.
Don't worry, I've been using Python for 15 years and there are
plenty modules I haven't explo
Il 28/07/2012 20:41, eryksun wrote:
On Sat, Jul 28, 2012 at 11:12 AM, Francesco Loffredo wrote:
I had to study carefully your present and desired lists, and I understood
what follows (please, next time explain !):
- each 7-tuple in your present list is a record for some measure relative to
a pe
Il 28/07/2012 19:43, Steven D'Aprano wrote:
Francesco Loffredo wrote:
but I must avoid reading my function again, or I'll find some more bugs!
Perhaps you should run your function, and test it.
Of course I did. Just not as thoroughly as I would if this were a job
commitment. Unfortunately, I
On Sat, Jul 28, 2012 at 11:12 AM, Francesco Loffredo wrote:
>
> I had to study carefully your present and desired lists, and I understood
> what follows (please, next time explain !):
> - each 7-tuple in your present list is a record for some measure relative to
> a person. Its fields are as follo
Francesco Loffredo wrote:
but I must avoid reading my function again, or
I'll find some more bugs!
Perhaps you should run your function, and test it.
Finding bugs is not the problem. Once you find them, you can fix them. It is
the bugs that you don't know about that is the problem.
--
Ste
Il 28/07/2012 17:12, Francesco Loffredo ha scritto:
Il 19/07/2012 19:33, PyProg PyProg ha scritto:
Hi all,
I would get a new list as:
[(0, '3eA', 'Dupont', 'Juliette', '11.0/10.0', '4.0/5.0', '17.5/30.0',
'3.0/5.0', '4.5/10.0', '35.5/60.0'), (1, '3eA', 'Pop', 'Iggy',
'12.0/10.0', '3.5/5.0', '1
Il 19/07/2012 19:33, PyProg PyProg ha scritto:
Hi all,
I would get a new list as:
[(0, '3eA', 'Dupont', 'Juliette', '11.0/10.0', '4.0/5.0', '17.5/30.0',
'3.0/5.0', '4.5/10.0', '35.5/60.0'), (1, '3eA', 'Pop', 'Iggy',
'12.0/10.0', '3.5/5.0', '11.5/30.0', '4.0/5.0', '5.5/10.0',
'7.5/10.0', '40.5/6
PyProg PyProg wrote:
Hi all,
I would get a new list as:
[(0, '3eA', 'Dupont', 'Juliette', '11.0/10.0', '4.0/5.0', '17.5/30.0',
'3.0/5.0', '4.5/10.0', '35.5/60.0'), (1, '3eA', 'Pop', 'Iggy',
'12.0/10.0', '3.5/5.0', '11.5/30.0', '4.0/5.0', '5.5/10.0',
'7.5/10.0', '40.5/60.0')]
... from this one:
> I would get a new list as:
>
> [(0, '3eA', 'Dupont', 'Juliette', '11.0/10.0', '4.0/5.0', '17.5/30.0',
> '3.0/5.0', '4.5/10.0', '35.5/60.0'), (1, '3eA', 'Pop', 'Iggy',
> '12.0/10.0', '3.5/5.0', '11.5/30.0', '4.0/5.0', '5.5/10.0',
> '7.5/10.0', '40.5/60.0')]
>
> ... from this one:
>
> [(0, '3eA'
You may use 'set'.
e.g.
===
>>> x
[(1, 2, 3), (1, 1), (2, 2), (1, 1), (2, 2)]
>>> set(x)
set([(2, 2), (1, 1), (1, 2, 3)])
===
On 19-Jul-2012, at 11:03 PM, PyProg PyProg wrote:
> Hi all,
>
> I would get a new list as:
>
> [(0, '3eA', 'Dupont', 'Juliette', '11.0/10.0', '4.0/5.0', '17.5/30.0',
>
Oh I forgot to mention, with Python 2 (2.7).
--
http://ekd.tuxfamily.org
http://ekdm.wordpress.com
http://glouk.legtux.org/guiescputil
http://lcs.dunois.clg14.ac-caen.fr/~alama/blog
http://lprod.org/wiki/doku.php/video:encodage:avchd_converter
___
Tutor
Hi all,
I would get a new list as:
[(0, '3eA', 'Dupont', 'Juliette', '11.0/10.0', '4.0/5.0', '17.5/30.0',
'3.0/5.0', '4.5/10.0', '35.5/60.0'), (1, '3eA', 'Pop', 'Iggy',
'12.0/10.0', '3.5/5.0', '11.5/30.0', '4.0/5.0', '5.5/10.0',
'7.5/10.0', '40.5/60.0')]
... from this one:
[(0, '3eA', 'Dupont',
24 matches
Mail list logo