Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: List representation using element position

  • To: mathgroup at smc.vnet.net
  • Subject: [mg72519] Re: List representation using element position
  • From: "Ray Koopman" <koopman at sfu.ca>
  • Date: Thu, 4 Jan 2007 06:40:18 -0500 (EST)
  • References: <enfgem$ss1$1@smc.vnet.net><enfvj8$6vc$1@smc.vnet.net>

Ray Koopman wrote:
> fPoz[lstIn_] := {#[[1,1]],Last/@#}& /@ Split[
> Sort@MapIndexed[Flatten@{##}&,lstIn], #1[[1]]==#2[[1]] ]

That should be

  fPoz[lstIn_] := {#[[1,1]],Last/@#}& /@ Split[
  Sort@MapIndexed[Flatten@{##}&,lstIn], #1[[1]]==#2[[1]]&]

which will still be slow but will at least get what was wanted.


  • Prev by Date: Re: Multiple streams in Write
  • Next by Date: Re: Is there Options for a variable
  • Previous by thread: Re: List representation using element position
  • Next by thread: Re: List representation using element position