Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!storethat.news.telefonica.de!telefonica.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Neil Cerutti Newsgroups: comp.lang.python Subject: Re: Good use for itertools.dropwhile and itertools.takewhile Date: 5 Dec 2012 20:13:41 GMT Organization: Norwich University Lines: 26 Message-ID: References: <26781aa9-b4a2-4308-8db2-5a150da2128f@googlegroups.com> <945048d8-961e-4894-89fc-3b7fd9b7965b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: individual.net Jg7BO3aSzd/Rzol4ylLi6QNRirnR/0Ri4RakOYiy/oO45Jh72QN1SkZpbSaHvNxFe+ Cancel-Lock: sha1:rwdasNEIhdKyWTO4Wvgg1jVWrJU= User-Agent: slrn/0.9.9p1/mm/ao (Win32) Xref: csiph.com comp.lang.python:34318 On 2012-12-05, Nick Mellor wrote: > Neil, > > Further down the data, found another edge case: > > "Spring ONION from QLD" > > Following the spec, the whole line should be description > (description starts at first word that is not all caps.) This > case breaks the latest groupby. A-ha! I did check your samples for the case of an empty product name and not find any started to think it couldn't happen. Change if prod or k: to if desc or prod or k: If this data file gets any weirder, let me know. ;) -- Neil Cerutti