On 4 February 2016 at 06:45, Matt Williams wrote:
>
> Just as a note - you are not the only person caught out by this - it is a
> very common slip.
>
> I wonder whether it would be worth adding a more explicit line about this
> in the Python Docs?
Where in the docs
On 4 February 2016 at 03:21, Ben Finney wrote:
> Alex Kleider writes:
>
>> How does a dict fit into this scheme?
>> Is it a sequence?
>
> No, a dict is not a sequence. But it is a container: all its items
> remain available and can be retrieved
On 2016-02-04 01:46, Oscar Benjamin wrote:
You can see an explanation of the different collection terminology
here:
https://docs.python.org/2/library/collections.html#collections-abstract-base-classes
A dict is a Mapping and a set is a Set. Both also comes under the
categories Sized,
Just as a note - you are not the only person caught out by this - it is a
very common slip.
I wonder whether it would be worth adding a more explicit line about this
in the Python Docs?
Matt
On Wed, 3 Feb 2016 16:13 Ek Esawi wrote:
> Hi All
>
>
>
>
>
> I have a code that
Ek Esawi writes:
> I have a code that reads a csv file via DictReader. I ran into a peculiar
> problem. The python interpreter ignores the 2nd code. That is if I put the
> reader iterator 1st, like the code below, the enumerate code is ignored; if
> I put the enumerate code
Thank you all. The only reason i tried both ways is to experiment with
Python. They made sense to me and thought why not try them both. And i am
relatively new to Python.
Thanks again--EKE
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
Alex Kleider writes:
> How does a dict fit into this scheme?
> Is it a sequence?
No, a dict is not a sequence. But it is a container: all its items
remain available and can be retrieved again and again, and you can
interrogate whether a value is one of the items in that
On 2016-02-03 13:24, Ben Finney wrote:
You have discovered the difference between an iterable (an object you
can iterate over with ‘for’), versus a sequence (an object whose items
remain in place and can be iterated many times).
Every sequence is an iterable, but not vice versa.
File objects
On 03/02/16 15:29, Ek Esawi wrote:
> reader = csv.DictReader(MyFile)
>
> for row in reader:
> list_values = list(row.values())
> print (list_values)
>
At this point the reader has reached the end of the file.
> for i,j in enumerate(reader):
> print(j)
So
Hi All
I have a code that reads a csv file via DictReader. I ran into a peculiar
problem. The python interpreter ignores the 2nd code. That is if I put the
reader iterator 1st, like the code below, the enumerate code is ignored; if
I put the enumerate code 1st, the reader code is ignored. I
> I have a code that reads a csv file via DictReader. I ran into a peculiar
> problem. The python interpreter ignores the 2nd code. That is if I put the
> reader iterator 1st, like the code below, the enumerate code is ignored; if
> I put the enumerate code 1st, the reader code is ignored. I am
11 matches
Mail list logo