Maric Michaud <[EMAIL PROTECTED]> writes:
> Le Friday 13 June 2008 17:55:44 Karsten Heymann, vous avez écrit :
>> Maric Michaud <[EMAIL PROTECTED]> writes:
>> > So, writing C in python, which has dictionnary as builtin type,
>> > should be considered "
Hi Maric,
Maric Michaud <[EMAIL PROTECTED]> writes:
> So, writing C in python, which has dictionnary as builtin type,
> should be considered "more elegant" ?
IMO that's a bit harsh.
> You are comparing apples with lemons, there is no such a difference
> between list index access and dictionnary
Paddy <[EMAIL PROTECTED]> writes:
> How does your solution fare against the defaultdict solution of:
>
> d = collections.defaultdict(int)
> for u,s in zip(users,score): d[u] += s
list: 0.931s
dict + "in": 1.495s
defaultdict : 1.991s
dict + "if": ~2s
dict + "try": ~4s
I've posted the (ve
Hi Björn,
"BJörn Lindqvist" <[EMAIL PROTECTED]> writes:
> On Fri, Jun 13, 2008 at 2:12 PM, Karsten Heymann
> <[EMAIL PROTECTED]> wrote:
>> summed_up={}
>> for user,vote in pairs:
>> if summed_up.has_key(user):
>>summed_up[user]+=vote
>&
Hi Mark,
Mark <[EMAIL PROTECTED]> writes:
> I have a scenario where I have a list like this:
>
> UserScore
> 1 0
> 1 1
> 1 5
> 2 3
> 2 1
> 3 2
> 4 3
> 4 3
> 4
Hi Jeff,
Jeff Nyman <[EMAIL PROTECTED]> writes:
> I did try this:
>
> for count in range(0, len(DC_List)):
> DC_List.insert(count, '')
On additional note: You can be quite sure you'll never have to iterate
over the length of a list (or tuple) in python. Just iterate over the
list itself:
for
Jeff Nyman <[EMAIL PROTECTED]> writes:
> from glob import glob
> DC_List = glob('vcdcflx006\\Flex\\Sites\\*\\')
> DC_List = ['Baltimore', 'Birmingham', 'Cincinnati', 'Cleveland',
> LosAngeles']
> The problem is that I need to pass this list to a list control in a
> wxWidgets application. In or