Analytics.DataFrame.getColumn()

Signature

Object[] getColumn(Object dataFrame, int columnIndex)

Domain

ACTION

Description

Returns the column specified by the column number from the data frame object.
If the column number specified is incorrect returns null value.

Parameters

NameTypeDescription
dataFrameObjectA TerrDataFrame type of Object
columnIndexintThe column number to be retrieved from the data frame

Returns

TypeDescription
Object[]The column retrieved from the TerrDataFrame Object.
If an incorrect column number is passed then a null Object is returned.

Cautions

none

Example

Object cust = Analytics.DataFrame.createFrame(names, data);
int columnNumber = 1;
Object[] col1 = Analytics.DataFrame.getColumn(cust,columnNumber);
When the getColumn returned is of type Factor, then the returned Object[] has a String array and an Integer array as the values returned
Usage when the column is a factor should be as follows:-
Object[] data = Analytics.DataFrame.getColumn(df,1);
String[] data0 = data[0];
int[] data1 = data[1];
The array data0 contains all unique elements and the array data1 represents the Levels.