Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: Extract values and multilpicities from list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg64876] Re: Extract values and multilpicities from list
  • From: "dkr" <dkrjeg at adelphia.net>
  • Date: Mon, 6 Mar 2006 05:01:34 -0500 (EST)
  • References: <due96k$ach$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In[5]:=
fun[x_List]:=Reap[Sow[1,x],_,{#1,Length[#2]}&][[2]]//Sort;
In[6]:=
lstIn={2,3,4,4,2,1,1,5,4};
In[7]:=
fun[lstIn]
Out[7]=
{{1,2},{2,2},{3,1},{4,3},{5,1}}

dkr


  • Prev by Date: Numerical solutions of SDE
  • Next by Date: Re: MatrixForm to JPG
  • Previous by thread: Re: Extract values and multilpicities from list
  • Next by thread: Re: Extract values and multilpicities from list