rmmissdim()

Read(526) Label: matrix, missing value,

Description:

Delete rows or columns containing missing values from a matrix.

Syntax:

A.rmmissdim(dim)

Delete rows or columns containing missing values from a matrix. When parameter dim is 1, the function works by row (the first dimension) and deletes all rows containing missing values; when parameter dim is 1, the function works by column (the second dimension) and deletes all columns containing missing values

A.rmmissdim(dim, minnum)

Delete rows or columns according to the specified minimum number of missing items; delete rows if dim value is 1; and delete columns if dim is 2;

When the number of missing items is greater than or equal to minnum value, delete the corresponding row or column; when the number of missing items is less than minnum value, automatically fill the missing values with 0

Note:

External library function (See External Library Guide). Parameter dim’s value can only be 1 or 2; default value is 1 when the parameter is absent.

Parameter:

A

A two-dimensional sequence

dim

Specifies a dimension

minnum

The minimum number of missing items

Return value:

Sequence

Example:

 

A

 

1

=[[1,2,3,],[4,5,6,7],[,8,9,]]

3 rows and 4 columns.

2

=A1.rmmissdim(1)

Delete by row and return a sequence of 1 row and 4 columns.

3

=A1.rmmissdim()

Same as A2.

4

=[[1,2,,,3,2,1],[2,3,,4,,,4],[22,3,4,5,,,]]

3 rows and 7 columns.

5

=A4.rmmissdim(2,2)

Delete by row; when the number of missing items in a column is greater than or equal to 2, delete the row and return a sequence of 3 rows and 4 columns.