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: Riddle with Ordering

  • To: mathgroup at smc.vnet.net
  • Subject: [mg77939] Re: Riddle with Ordering
  • From: Ray Koopman <koopman at sfu.ca>
  • Date: Wed, 20 Jun 2007 05:30:45 -0400 (EDT)
  • References: <f58dbg$8gi$1@smc.vnet.net>

On Jun 19, 4:06 am, nazdro... at gmail.com wrote:
> Just a gem I discovered with Ordering[ ].
>
> Anyone have an idea what
>
> SomeArrayWithUniqueReals // Ordering // Ordering
>
> does?
>
> I like this, especially the double use of Ordering. Answer tomorrow.

   Ordering@Ordering@x

gives the ranks of the elements of x, with ties broken according to
position in x. To give tied values their average rank, use

  (Ordering@Ordering@x + Reverse@Ordering@Ordering@Reverse@x)/2



  • Prev by Date: Re: MatrixPlot: frame ticks starting with 0?
  • Next by Date: Re: MatrixPlot: frame ticks starting with 0?
  • Previous by thread: Re: Riddle with Ordering
  • Next by thread: Re: Riddle with Ordering