Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #30507

Re: Slicing iterables in sub-generators without loosing elements

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <thbach@students.uni-mainz.de>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.069
X-Spam-Evidence '*H*': 0.86; '*S*': 0.00; 'sep': 0.09; 'sat,': 0.15; 'lambda': 0.16; 'subject:sub': 0.16; 'wrote:': 0.17; 'basically': 0.17; 'thanks,': 0.18; 'paul': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; '-0700,': 0.29; 'writes:': 0.29; 'to:addr:python-list': 0.33; 'charset:us-ascii': 0.36; 'subject:: ': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'subject:-': 0.40; 'content-disposition:inline': 0.60; 'thomas': 0.62; 'received:10.94': 0.84; 'true!': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=uni-mainz.de; i=@uni-mainz.de; q=dns/txt; s=ironport; t=1348937095; x=1380473095; h=date:from:to:subject:message-id:references:mime-version: in-reply-to; bh=mS4WjFglcRan2mPmf+OWjW+62beOVa5ED0IMtccfNFc=; b=ARFudAgconueIrZ6kVSl5bcUl07fZjVy4HOY4iocOHagr62wQreOJoMP jeXe1b2dNdtqA9CjU6BOM7HwnJ35J0TQBZbH1vakG93D/6Fx+neUMa4Hj VCgGBxos+XPm01k1v74O8l/oQs5W/TABRqUO/jJwqX+brZS520dO5vGti M=;
X-IronPort-Anti-Spam-Filtered true
X-IronPort-Anti-Spam-Result ApwEAOskZ1AKXgZQ/2dsb2JhbABFvziCIAEBBTpPCxgeEBQpIBOICbl1ix+DK4JAYAOVaAGQK4JpghU
Date Sat, 29 Sep 2012 18:44:51 +0200
From Thomas Bach <thbach@students.uni-mainz.de>
To <python-list@python.org>
Subject Re: Slicing iterables in sub-generators without loosing elements
References <mailman.1636.1348935354.27098.python-list@python.org> <7xpq54u76v.fsf@ruckus.brouhaha.com>
MIME-Version 1.0
Content-Type text/plain; charset="us-ascii"
Content-Disposition inline
In-Reply-To <7xpq54u76v.fsf@ruckus.brouhaha.com>
User-Agent Mutt/1.5.21 (2010-09-15)
X-Originating-IP [94.219.181.175]
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1639.1348937096.27098.python-list@python.org> (permalink)
Lines 11
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1348937097 news.xs4all.nl 6871 [2001:888:2000:d::a6]:46711
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:30507

Show key headers only | View raw


On Sat, Sep 29, 2012 at 09:26:00AM -0700, Paul Rubin wrote:
> Thomas Bach <thbach@students.uni-mainz.de> writes:
> 
> itertools.groupby(data, lambda (x,y) : x)
> 
> is basically what you want.

True!

Thanks,
       Thomas Bach

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Slicing iterables in sub-generators without loosing elements Thomas Bach <thbach@students.uni-mainz.de> - 2012-09-29 18:14 +0200
  Re: Slicing iterables in sub-generators without loosing elements Paul Rubin <no.email@nospam.invalid> - 2012-09-29 09:26 -0700
    Re: Slicing iterables in sub-generators without loosing elements Thomas Bach <thbach@students.uni-mainz.de> - 2012-09-29 18:44 +0200
  Re: Slicing iterables in sub-generators without loosing elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-30 17:58 -0700
    Re: Slicing iterables in sub-generators without loosing elements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-01 09:19 +0100
      Re: Slicing iterables in sub-generators without loosing elements Ramchandra Apte <maniandram01@gmail.com> - 2012-10-02 09:12 -0700
        Re: Slicing iterables in sub-generators without loosing elements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-02 17:44 +0100
          Re: Slicing iterables in sub-generators without loosing elements Ramchandra Apte <maniandram01@gmail.com> - 2012-10-02 20:21 -0700
          Re: Slicing iterables in sub-generators without loosing elements Ramchandra Apte <maniandram01@gmail.com> - 2012-10-02 20:21 -0700
        Re: Slicing iterables in sub-generators without loosing elements Chris Angelico <rosuav@gmail.com> - 2012-10-03 03:58 +1000
          Re: Slicing iterables in sub-generators without loosing elements Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-03 00:57 +0000
            Re: Slicing iterables in sub-generators without loosing elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-10-02 18:11 -0700
              Re: Slicing iterables in sub-generators without loosing elements Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-03 01:24 +0000
                Re: Slicing iterables in sub-generators without loosing elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-10-02 18:42 -0700
        Re: Slicing iterables in sub-generators without loosing elements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-02 19:35 +0100
        Re: Slicing iterables in sub-generators without loosing elements Terry Reedy <tjreedy@udel.edu> - 2012-10-02 14:59 -0400
      Re: Slicing iterables in sub-generators without loosing elements Ramchandra Apte <maniandram01@gmail.com> - 2012-10-02 09:12 -0700
      Re: Slicing iterables in sub-generators without loosing elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-10-02 13:54 -0700
      Re: Slicing iterables in sub-generators without loosing elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-10-02 13:54 -0700
  Re: Slicing iterables in sub-generators without loosing elements 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-30 17:58 -0700

csiph-web