MathGroup Archive 2007

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

Search the Archive

Re: ordered positions (OrderedPosition?)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83431] Re: ordered positions (OrderedPosition?)
  • From: Ray Koopman <koopman at sfu.ca>
  • Date: Tue, 20 Nov 2007 03:53:00 -0500 (EST)
  • References: <fhrrsj$5gh$1@smc.vnet.net>

In[1]:= data = {{4, 3, 3, 5, 1, 2, 5, 2, 3, 2},
                {1, 5, 4, 1, 3, 4, 1, 7, 3, 4}};

In[2]:= Position[data,_,{2},Heads->False][[Ordering@Flatten@data]]

Out[2]={{1,5},{2,1},{2,4},{2,7},{1,6},{1,8},{1,10},{1,2},{1,3},{1,9},
        {2,5},{2,9},{1,1},{2,3},{2,6},{2,10},{1,4},{1,7},{2,2},{2,8}}


  • Prev by Date: Scalars Instead of Lists with One Element
  • Next by Date: Re: MapThread over ragged arrays
  • Previous by thread: ordered positions (OrderedPosition?)
  • Next by thread: Re: ordered positions (OrderedPosition?)