(Apologies in advance for breaking threading, but the original post in
this thread doesn't appear for me.)
> On Tue, Feb 7, 2012 at 5:27 AM, Sammy Danso
> wrote:
>>
>> Hello experts,
>> I am having trouble accessing the content of my list. my list content
>> has 2-pair value with the exception o
On 7 February 2012 22:57, Dennis Lee Bieber wrote:
> On Tue, 7 Feb 2012 21:37:20 +, Arnaud Delobelle
> wrote:
>
>
>>
>>Your list is flat so the unpacking fails. For it to work, you need
>>your list to be of the form:
>>
>> wordFreq2 = [('with', 3), ('which', 1), ('were', 2), ('well', 1)]
On 02/07/2012 11:09 PM, Mark Lawrence wrote:
On 07/02/2012 21:25, Aaron France wrote:
for i in range(0, len(x), 2):
print x[i-1], x[i]
x = ['with', 3, 'which', 1, 'were', 2, 'well', 1, 'water', 1, 'was', 4,
'two', 1, 'to', 2, 'through', 1, 'thlabour', 1, 'these', 1, 'theat', 1,
'the', 8, '
On 07/02/2012 21:25, Aaron France wrote:
for i in range(0, len(x), 2):
print x[i-1], x[i]
x = ['with', 3, 'which', 1, 'were', 2, 'well', 1, 'water', 1, 'was', 4,
'two', 1, 'to', 2, 'through', 1, 'thlabour', 1, 'these', 1, 'theat', 1,
'the', 8, 'tetanus', 1, 'started', 1, 'size', 1, 'scent',
On 7 February 2012 20:23, Sammy Danso wrote:
>
> Hi Expert,
> Thanks for your responses and help. thought I should provide more information
> for clarity.
Please don't top-post.
> Please find the error message below for more information
>
> for (key, value) in wordFreq2:
> ValueError: need m
On Wed, Feb 8, 2012 at 8:25 AM, Aaron France
wrote:
> for i in range(0, len(x), 2):
> print x[i-1], x[i]
I think you want x[i], x[i+1] here, but in any case, this is a fairly
standard non-Python way to do this sort of thing. There's a variety of
more Pythonic ways to loop, but every now and th
Thanks for your responses and help. thought I should provide
more information for clarity.
It sounds like you want the "grouper" function as defined here:
http://docs.python.org/library/itertools.html#recipes
which does what you describe.
-tkc
--
http://mail.python.org/mailman/listinfo/pyth
On 02/07/2012 10:13 PM, MRAB wrote:
On 07/02/2012 20:23, Sammy Danso wrote:
Hi Expert,
Thanks for your responses and help. thought I should provide more
information for clarity.
>
Please find the error message below for more information
for (key, value) in wordFreq2:
ValueError: need more
On 07/02/2012 20:23, Sammy Danso wrote:
Hi Expert,
Thanks for your responses and help. thought I should provide more
information for clarity.
>
Please find the error message below for more information
for (key, value) in wordFreq2:
ValueError: need more than 1 value to unpack
this is a sam
On 02/07/2012 03:23 PM, Sammy Danso wrote:
Please don't top-post. It hopelessly mixes responses out of order.
Hi Expert,
Thanks for your responses and help. thought I should provide more information
for clarity.
Please find the error message below for more information
for (key, value)
;, 1, 'difficulty', 1, 'cord', 1, 'consecutive', 1, 'colour', 1,
'cleared', 1, 'child', 1, 'checkups', 1, 'came', 1, 'but', 2, 'breathing', 2,
'breath', 1, 'blood', 2, 'blee
On 02/07/12 09:34, Rick Johnson wrote:
On Feb 7, 8:46 am, Dave Angel wrote:
On 02/07/2012 07:27 AM, Sammy Danso wrote:> Hello experts,
I am having trouble accessing the content of my list. my
list content has 2-pair value with the exception of one
which has single value. here is an example [
On Tue, Feb 7, 2012 at 5:27 AM, Sammy Danso wrote:
>
> Hello experts,
> I am having trouble accessing the content of my list.
> my list content has 2-pair value with the exception of one which has single
> value. here is an example ['a', 1, 'b', 1, 'c', 3, 'd']
>
> I am unable to iterate through
On Feb 7, 8:46 am, Dave Angel wrote:
> On 02/07/2012 07:27 AM, Sammy Danso wrote:> Hello experts,
> > I am having trouble accessing the content of my list.
> > my list content has 2-pair value with the exception of one which has single
> > value. here is an example ['a', 1, 'b', 1, 'c', 3, 'd']
On 02/07/2012 07:27 AM, Sammy Danso wrote:
Hello experts,
I am having trouble accessing the content of my list.
my list content has 2-pair value with the exception of one which has single
value. here is an example ['a', 1, 'b', 1, 'c', 3, 'd']
I am unable to iterate through list to access in
15 matches
Mail list logo