A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2010-March/720783.html below:

loop over list and process into groups

loop over list and process into groups loop over list and process into groupsPaul Rubin no.email at nospam.invalid
Fri Mar 5 04:45:54 EST 2010
lbolla <lbolla at gmail.com> writes:
> for k, g in groupby(clean_up(data) , key=lambda s: s.startswith('VLAN')):
> 	if k:
> 		key = list(g)[0].replace('VLAN','')

This is the nicest solution, I think.  Mine was more cumbersome.

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4