MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Partition a list into sublists of unequal size

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83953] Re: Partition a list into sublists of unequal size
  • From: Ray Koopman <koopman at sfu.ca>
  • Date: Wed, 5 Dec 2007 07:14:56 -0500 (EST)
  • References: <fj37cv$hq0$1@smc.vnet.net>

This is a little simpler and maybe a little faster:

  Take[targetlist,#]& /@ Transpose@{Prepend[Most@#+1,1],#}& @
    Flatten@Position[list,1]


  • Prev by Date: Re: Insert a Math Symbol in Text in Notebook?
  • Next by Date: Adding coloured Polygon to a BarChart
  • Previous by thread: Re: Partition a list into sublists of unequal size
  • Next by thread: Re: Partition a list into sublists of unequal size