sort numeric data - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Statistics : Statistics Package : Data Manipulation : Statistics/Sort

Statistics[Sort] - sort numeric data

Calling Sequence

Sort(X, options)

Parameters

X

-

data sample

options

-

(optional) equation(s) of the form option=value where option is one of order or unique; specify options for the Sort function

Description

• 

The Sort command sorts the elements of X according to their numeric values.

• 

The first parameter X is the data set (typically an Array or a list).

Options

  

The options argument can contain one or more of the options shown below.

• 

order=ascending or descending -- Indicates whether the elements of X should be sorted in the ascending or descending order. The default value is order=ascending.

• 

unique=truefalse -- If this option is set to true, all multiple occurrences of elements from X will be removed. The default value is unique=false. Note that if this option is set to unique=true then all elements of X must be of type float.

Notes

• 

Although the Sort command accepts non-numeric data, maple must be able to compute floating-point values for all elements in X. If the unique option is set to unique=true all elements in X must be of type numeric.

• 

The Sort command creates a copy of the original data.

Examples

withStatistics:

A:=Arraysin1,sin2.,sin1.,sin3.,sin5.,sin2.,sin3.,sin6.

A:=sin10.90929742680.84147098480.14112000810.95892427470.90929742680.14112000810.2794154982

(1)

B:=SortA

B:=0.95892427470.27941549820.14112000810.14112000810.8414709848sin10.90929742680.9092974268

(2)

evalfB

0.95892427470.27941549820.14112000810.14112000810.84147098480.84147098480.90929742680.9092974268

(3)

SortA,order=descending

0.90929742680.9092974268sin10.84147098480.14112000810.14112000810.27941549820.9589242747

(4)

B:=evalfA

B:=0.84147098480.90929742680.84147098480.14112000810.95892427470.90929742680.14112000810.2794154982

(5)

SortB,order=descending,unique

0.90929742680.84147098480.14112000810.27941549820.9589242747

(6)

l:=sin1,sin2.,sin1.,sin3.,sin5.,sin2.,sin3.,sin6.

l:=sin1,0.9092974268,0.8414709848,0.1411200081,0.9589242747,0.9092974268,0.1411200081,0.2794154982

(7)

ll:=Sortl

ll:=0.9589242747,0.2794154982,0.1411200081,0.1411200081,0.8414709848,sin1,0.9092974268,0.9092974268

(8)

evalfll

0.9589242747,0.2794154982,0.1411200081,0.1411200081,0.8414709848,0.8414709848,0.9092974268,0.9092974268

(9)

See Also

Statistics, Statistics[Computation], Statistics[OrderByRank], Statistics[Rank]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam