Data Manipulation Commands - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Statistics and Data Analysis : Statistics Package : Data Manipulation : Statistics/DataManipulation

Data Manipulation Commands

  

The Statistics package provides various functions for manipulating statistical data. These include sorting, searching, and data selection routines. The following is a list of available commands.

  

 

Count

compute number/total weight of observations

CountMissing

compute number/total weight of missing values

CumulativeProduct

compute cumulative products

CumulativeSum

compute cumulative sums

EvaluateToFloat

evaluate data using floating-point arithmetic

Excise

remove data items based on density

Join

join data samples

OrderByRank

order data items according to their ranks

Rank

rank data items according to their numeric values

Remove

remove data items satisfying a condition

RemoveInRange

remove data items which belong to the given range

RemoveNonNumeric

remove non-numeric values

Scale

center and/or scale a set of data

Select

select data items satisfying a condition

SelectInRange

select data items which belong to the given range

SelectNonNumeric

select non-numeric values

Shuffle

apply random permutation to a data sample

Sort

sort numeric data

SplitByColumn

split matrix data into submatrices

Tally

compute data frequencies

TallyInto

compute cumulative data frequencies

Trim

trim data set

Winsorize

winsorize data set

• 

The ArrayTools package provides a number of useful tools for manipulating rectangular arrays. Here is the list of available commands.

  

 

AddAlongDimension

add the elements of an Array

Alias

provide different view of rectangular Matrix, Vector, or Array

AllNonZero

true when the Array has no zero entries

AnyNonZeros

check for nonzero Array entries

Append

append an element to an Array

BlockCopy

copy a block of several segments of elements from one Matrix, Vector, or Array to another

CircularShift

shift Array data

ComplexAsFloat

provide real view of a complex Matrix, Vector, or Array

Concatenate

Array concatenation

Copy

copy portion of Matrix, Vector, or Array to another

DataTranspose

perform in-place data transpose

Diagonal

extract the diagonals from a Matrix or create a diagonal Matrix

Dimensions

size of an Array in each dimension

ElementDivide

element-wise division of Array entries

ElementMultiply

element-wise multiplication of Array entries

ElementPower

element-wise power of Array entries

Extend

extend an Array with additional elements

Fill

fill portion of Matrix, Vector, or Array with specified value

FlipDimension

reverse order of elements in an Array

HasNonZero

true when the Array has a nonzero entry

HasZero

true when the Array has a zero entry

Insert

insert an element in an Array

IsEqual

compare Arrays for equality

IsZero

true when the Array has only zero entries

LowerTriangle

return the lower triangular region of a matrix

MultiplyAlongDimension

multiply rows of an array

NumElems

return the number of elements in an Array

Permute

permute dimensions of an Array

PermuteInverse

inverse permute dimensions of an Array

RandomArray

randomly generate scalars, Matrices, and Arrays of values drawn from a uniform or normal distribution

RegularArray

generate an array of numbers with specified spacing in a given range

RemoveSingletonDimensions

remove singleton Array dimensions

Replicate

Array replication

Reshape

create a reshaped copy of a Matrix, Vector, or Array

SearchArray

return the indices of nonzero elements of the given Array

Size

return the size of an Array in each dimension

UpperTriangle

compute the upper triangular  Matrix

Examples

withStatistics:

XSampleNormal0,1,100

X:= 1 .. 100 VectorrowData Type: float8Storage: rectangularOrder: Fortran_order

(1)

Select only values between -2 and 2;

YSelectInRangeX,2..2

Y:= 1 .. 99 VectorrowData Type: float8Storage: rectangularOrder: Fortran_order

(2)

Select only values between 5th and 95th percentiles (trim).

ZTrimX,5,95

Z:= 1 .. 90 VectorcolumnData Type: float8Storage: rectangularOrder: Fortran_order

(3)

Replace extreme points with the values of the 5th or the 95th percentile (whichever is closer).

WWinsorizeX,5,95

W:= 1 .. 100 VectorrowData Type: float8Storage: rectangularOrder: Fortran_order

(4)

W1..10

1.300309054115871.300309054115871.300309054115871.300309054115871.300309054115871.300309054115870.8616659473088021.197548434048331.167373085324711.15469196092625

(5)

Sort 2-D array according to the numeric values in the second column.

Aseqi,i=1..10|seqsini,i=1..10

A:=1sin12sin23sin34sin45sin56sin67sin78sin89sin910sin10

(6)

RRankA1..10,2

R:=89521471063

(7)

BOrderByRankA,R

B:=5sin54sin410sin106sin63sin39sin97sin71sin12sin28sin8

(8)

evalfB

5.0.95892427474.0.756802495310.0.54402111096.0.27941549823.0.14112000819.0.41211848527.0.65698659871.0.84147098482.0.90929742688.0.9893582466

(9)

Handling non-numeric data.

A1,4,3,4,5,undefined:

B4,undefined,∞:

Ca,b,c,a,b,a:

Join samples A, B, and C

UJoinA,B,C

U:= 1 .. 15 ArrayData Type: anythingStorage: rectangularOrder: Fortran_order

(10)

Remove non-numeric values (keep missing values).

VRemoveNonNumericU,exclude=undefined

V:=14345undefined4undefined

(11)

Count total number of values and the number of missing values in V.

CountV

8

(12)

CountMissingV

2

(13)

The same using weights.

W12,13,14,15,16,17,18,19:

CountMissingV

2

(14)

CountMissingV,weights=W

0.253968253968254

(15)

See Also

Statistics

Statistics[Computation]

Statistics[DataSmoothing]

 


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