Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #30762
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2012-10-04 17:40 -0700 |
| References | <7c7beccb-72e4-4cfb-958d-4a7235076fb3@googlegroups.com> <CALwzidnEKReQiHNEHekFByxEENQbvOHff8L=AOk2Hir7J1dN4g@mail.gmail.com> <mailman.1810.1349384780.27098.python-list@python.org> <307d5843-af17-4079-8a48-f8d7351a1d7b@googlegroups.com> <mailman.1813.1349386825.27098.python-list@python.org> |
| Subject | Re: sum function |
| From | Mike <mike20007@gmail.com> |
| Message-ID | <mailman.1821.1349397657.27098.python-list@python.org> (permalink) |
On Thursday, October 4, 2012 5:40:26 PM UTC-4, Dave Angel wrote:
> On 10/04/2012 05:29 PM, Mike wrote:
>
> > I get below error
>
> >
>
> > NameError: name 'functools' is not defined
>
> >
>
>
>
> functools is a module in the standard library. You need to import it.
>
>
>
> import functools
>
>
>
>
>
>
>
> --
>
>
>
> DaveA
I imported functools. Now I get the below error please.
Traceback (most recent call last):
File "test.py", line 16, in <module>
total = sum(float(col.value) for r in iter(next_r, None) for col in r.itervalues())
File "test.py", line 16, in <genexpr>
total = sum(float(col.value) for r in iter(next_r, None) for col in r.itervalues())
AttributeError: 'list' object has no attribute 'itervalues'
Thanks
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
sum function mike20007@gmail.com - 2012-10-04 13:52 -0700
Re: sum function Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-04 15:04 -0600
Re: sum function Mike <mike20007@gmail.com> - 2012-10-04 14:31 -0700
Re: sum function Mike <mike20007@gmail.com> - 2012-10-04 14:31 -0700
Re: sum function Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-04 15:05 -0600
Re: sum function Mike <mike20007@gmail.com> - 2012-10-04 14:29 -0700
Re: sum function Dave Angel <d@davea.name> - 2012-10-04 17:39 -0400
Re: sum function Mike <mike20007@gmail.com> - 2012-10-04 17:40 -0700
Re: sum function Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-04 18:59 -0600
Re: sum function Mike <mike20007@gmail.com> - 2012-10-04 19:01 -0700
Re: sum function Ramchandra Apte <maniandram01@gmail.com> - 2012-10-05 01:31 -0700
Re: sum function Ramchandra Apte <maniandram01@gmail.com> - 2012-10-05 01:31 -0700
Re: sum function Mike <mike20007@gmail.com> - 2012-10-04 19:01 -0700
Re: sum function Mike <mike20007@gmail.com> - 2012-10-04 17:40 -0700
Re: sum function Chris Angelico <rosuav@gmail.com> - 2012-10-05 07:34 +1000
Re: sum function Mike <mike20007@gmail.com> - 2012-10-04 14:29 -0700
Re: sum function Mike <mike20007@gmail.com> - 2012-10-05 06:39 -0700
Re: sum function Ramchandra Apte <maniandram01@gmail.com> - 2012-10-05 06:41 -0700
Re: sum function Mike <mike20007@gmail.com> - 2012-10-05 06:47 -0700
Re: sum function Terry Reedy <tjreedy@udel.edu> - 2012-10-05 14:52 -0400
Re: sum function Mike <mike20007@gmail.com> - 2012-10-05 13:09 -0700
Re: sum function Dave Angel <d@davea.name> - 2012-10-05 16:26 -0400
Re: sum function Ramchandra Apte <maniandram01@gmail.com> - 2012-10-06 05:38 -0700
Re: sum function Mike <mike20007@gmail.com> - 2012-10-05 13:09 -0700
Re: sum function Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-05 13:29 -0600
Re: sum function Mike <mike20007@gmail.com> - 2012-10-05 13:03 -0700
Re: sum function Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-05 14:10 -0600
Re: sum function Mike <mike20007@gmail.com> - 2012-10-05 14:19 -0700
csiph-web