Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Sibylle Koczian Newsgroups: comp.lang.python Subject: Re: how to create a dictionary from csv file? Date: Wed, 27 Apr 2016 17:37:10 +0200 Lines: 17 Message-ID: References: <246c571e-1793-4aa6-9405-19d7a1355598@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de wYTJJg0kqpEzpmsJdYQs/A7A35IOQecS39rUVN2R1FxQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.035 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'received:192.168.178': 0.07; 'subject:file': 0.07; 'csv': 0.09; 'subject:create': 0.09; 'message-id:@web.de': 0.16; 'received:192.168.178.22': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'header:In-Reply-To:1': 0.24; 'module': 0.25; 'header:User- Agent:1': 0.26; 'quite': 0.35; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'why': 0.39; 'data': 0.39; 'subject:from': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'received:194': 0.61; 'charset:windows-1252': 0.62; 'sample': 0.63; "op's": 0.84; 'sorry.': 0.91 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: X-ID: Zk87R6ZBohOVUHcLR-gi1F3yeHiZ8PMX8ugeJQGzJIahYZA0duW7rbaa-YRkmnhZQx X-TOI-MSGID: 12906114-b523-4ea8-9a7b-938caf1f0822 X-Mailman-Approved-At: Wed, 27 Apr 2016 12:10:04 -0400 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <246c571e-1793-4aa6-9405-19d7a1355598@googlegroups.com> Xref: csiph.com comp.lang.python:107730 Am 27.04.2016 um 11:31 schrieb Peter Otten: > Sibylle Koczian wrote: > >> 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 > Quite right, it wouldn't. Misread the problem, sorry.