NANRESHAPE

Purpose:

Converts a series into a table based on NaN values.

Syntax:

NANRESHAPE(series)

series

-

A series or table.

Returns:

A multi-column table of NaNs exist in the input.

Example:

W1: {1, 2, 3, nan, nan, 4, 5, 6, nan, nan, nan, 6, 7, 8}

W2: nanreshape(W1)

 

W2 contains the table

 

{{1, 4, 6},

 {2, 5, 7},

 {3, 6, 8}}

Remarks:

NANRESHAPE uses the locations of NaN values of a single column series to determine column delimiters.  Consecutive NaN values are treated as a single column delimiter.

 

The delimiters determine the lengths of the resulting output columns.

 

If the series does not contain any NaNs, the original series  is returned.

 

If the series contains all NaNs, an empty series is returned.

See Also:

NAN

NAFILL

RAVEL

RESHAPE