On 5/25/14 10:09 PM, Dave Angel wrote:
Ned Batchelder Wrote in message:
On 5/25/14 8:55 AM, Igor Korot wrote:
Hi, ALL,
I have a following data structure:
my_dict[(var1,var2,var3)] = None
my_dict[(var4,var5,var6)] = 'abc'
What I'm trying to do is this:
for (key,value) in my_dict:
#Do s
Ned Batchelder Wrote in message:
> On 5/25/14 8:55 AM, Igor Korot wrote:
>> Hi, ALL,
>> I have a following data structure:
>>
>> my_dict[(var1,var2,var3)] = None
>> my_dict[(var4,var5,var6)] = 'abc'
>>
>> What I'm trying to do is this:
>>
>> for (key,value) in my_dict:
>> #Do some stuff
>>
>>
On Sun, May 25, 2014 at 11:22 PM, Roy Smith wrote:
> Hint: in this case,
> it will happen on the assignment line, so, your next step is to print
> everything out and see what's going on:
>
> for thing in my_dict:
> print thing
> (key, value) = thing
Aside: I know that you (Roy) are still
On 5/25/14 8:55 AM, Igor Korot wrote:
Hi, ALL,
I have a following data structure:
my_dict[(var1,var2,var3)] = None
my_dict[(var4,var5,var6)] = 'abc'
What I'm trying to do is this:
for (key,value) in my_dict:
#Do some stuff
but I'm getting an error "Too many values to unpack".
What am I
In article ,
Igor Korot wrote:
> for (key,value) in my_dict:
> #Do some stuff
>
> but I'm getting an error "Too many values to unpack".
Several people have already given you the right answer, so I'll just
suggest a general debugging technique. Break this down into the
smallest possible
On 2014-05-25 05:59, Paul Rubin wrote:
> Igor Korot writes:
> > for (key,value) in my_dict:
> > #Do some stuff
> >
> > but I'm getting an error "Too many values to unpack".
>
> Use
> for (key,value) in mydict.iteritems(): ...
You can even use
for ((k1,k2,k3), value) in mydict.iterite
Igor Korot writes:
> for (key,value) in my_dict:
> #Do some stuff
>
> but I'm getting an error "Too many values to unpack".
Use
for (key,value) in mydict.iteritems(): ...
otherwise you loop through just the keys, whicn in your dictionary
happens to be 3-tuples. So you try to unpack a 3
Hi, ALL,
I have a following data structure:
my_dict[(var1,var2,var3)] = None
my_dict[(var4,var5,var6)] = 'abc'
What I'm trying to do is this:
for (key,value) in my_dict:
#Do some stuff
but I'm getting an error "Too many values to unpack".
What am I doing wrong?
Thank you.
--
https://mail