Statistics - Maple Help

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

Statistics

 SelectNonNumeric
 select non-numeric values
 RemoveNonNumeric
 remove non-numeric values

 Calling Sequence SelectNonNumeric(X, options) RemoveNonNumeric(X, options)

Parameters

 X - options - (optional) equation of the form exclude=value

Description

 • The SelectNonNumeric function selects non-numeric items from X and returns them in a new data sample. Note, that an expression X is considered non-numeric if $\mathrm{evalf}\left(X\right)$ does not return a floating-point number. Numeric items are discarded in the newly created data sample.
 • The first parameter X is a data sample - given as e.g. a Vector.
 • The RemoveNonNumeric function does the opposite of SelectNonNumeric. It removes the non-numeric values from X.

Options

 The options argument can contain one or more of the options shown below.
 • exclude=infinity, undefined, or [infinity, undefined] -- By default, undefined and infinity are considered non-numeric. This can be changed by adding infinity or undefined or both to the exclude list. Thus, exclude=undefined means that infinity should still be considered numeric but undefined should not.

Examples

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$
 > $A≔\mathrm{Array}\left(\left[3,3,1,a,b,a,\mathrm{π},\mathrm{sin}\left(1\right),\mathrm{undefined},\mathrm{∞}\right]\right)$
 ${A}{:=}\left[\begin{array}{cccccccccc}{3}& {3}& {1}& {a}& {b}& {a}& {\mathrm{π}}& {\mathrm{sin}}{}\left({1}\right)& {\mathrm{undefined}}& {\mathrm{∞}}\end{array}\right]$ (1)
 > $\mathrm{RemoveNonNumeric}\left(A\right)$
 $\left[\begin{array}{ccccc}{3}& {3}& {1}& {\mathrm{π}}& {\mathrm{sin}}{}\left({1}\right)\end{array}\right]$ (2)
 > $\mathrm{SelectNonNumeric}\left(A,\mathrm{exclude}=\left[\mathrm{undefined}\right]\right)$
 $\left[\begin{array}{cccc}{a}& {b}& {a}& {\mathrm{∞}}\end{array}\right]$ (3)
 > $\mathrm{RemoveNonNumeric}\left(A,\mathrm{exclude}=\left[\mathrm{undefined}\right]\right)$
 $\left[\begin{array}{cccccc}{3}& {3}& {1}& {\mathrm{π}}& {\mathrm{sin}}{}\left({1}\right)& {\mathrm{undefined}}\end{array}\right]$ (4)
 > $\mathrm{SelectNonNumeric}\left(A\right)$
 $\left[\begin{array}{ccccc}{a}& {b}& {a}& {\mathrm{undefined}}& {\mathrm{∞}}\end{array}\right]$ (5)
 > $B≔\mathrm{Array}\left(\left[1,2,3,4,\mathrm{undefined},\mathrm{∞}\right],\mathrm{datatype}=\mathrm{float}[8]\right)$
 ${B}{:=}\left[\begin{array}{cccccc}{1.}& {2.}& {3.}& {4.}& {\mathrm{HFloat}}{}\left({\mathrm{undefined}}\right)& {\mathrm{HFloat}}{}\left({\mathrm{∞}}\right)\end{array}\right]$ (6)
 > $\mathrm{RemoveNonNumeric}\left(B\right)$
 $\left[\begin{array}{cccc}{1.}& {2.}& {3.}& {4.}\end{array}\right]$ (7)
 > $\mathrm{RemoveNonNumeric}\left(B,\mathrm{exclude}=\left[\mathrm{∞}\right]\right)$
 $\left[\begin{array}{ccccc}{1.}& {2.}& {3.}& {4.}& {\mathrm{HFloat}}{}\left({\mathrm{∞}}\right)\end{array}\right]$ (8)