Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19991
| References | <1328646189.84221.YahooMailClassic@web161206.mail.bf1.yahoo.com> <CAJ6cK1aoMdpdO98oHBvmwVzXq_5bW4yvwU1FuR-tjtXGA72ULg@mail.gmail.com> <9na3j751i8q3ks75sda28edig2qclghfht@4ax.com> |
|---|---|
| Date | 2012-02-07 23:03 +0000 |
| Subject | Re: iterating over list with one mising value |
| From | Arnaud Delobelle <arnodel@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.5522.1328655833.27778.python-list@python.org> (permalink) |
On 7 February 2012 22:57, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
> On Tue, 7 Feb 2012 21:37:20 +0000, Arnaud Delobelle <arnodel@gmail.com>
> 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)]
>>
>>Then it will work. The quickest way to transform your list to the
>>required form is something like this:
>>
> Well... From my viewpoint, the quickest way is to load the list
> correctly in the first place... Where does this list come from? If it's
> a file of
Of course, but how much guessing can you do in a reply? The OP
provided a Python list, that's what I used.
--
Arnaud
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: iterating over list with one mising value Arnaud Delobelle <arnodel@gmail.com> - 2012-02-07 23:03 +0000
csiph-web