how to create a dictionary from csv file?
Peter Otten
__peter__ at web.de
Wed Apr 27 05:31:02 EDT 2016
Sibylle Koczian wrote:
> Am 27.04.2016 um 04:42 schrieb jfong at ms4.hinet.net:
>> Just curious:-) why everyone here open the csv file without using
>> newline='' as suggested in Python 3.4.4 document section 14.1?
Carelessness, lack of knowledge (I plead guilty), not on Windows and no
embedded newline in sight?
> And if the csv module is used anyway, why not simply read into a
> DictReader?
How would that help with looking up 3.5 by "apple" given the OP's sample
data
banana,4.0
apple,3.5
orange,3.0
? Please give a code example.
Finally, why would you think that asking rhetorical questions is a good way
to communicate?
More information about the Python-list
mailing list