MathGroup Archive 2007

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

Search the Archive

Re: Riddle with Ordering


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