what does the indices function return?

I have a dataset file in which uno is a column.

{ weight,wtind } = indices(dataset,"uno"). 

Here, when I'm printing wtind it's giving the column number of uno and in case of  weight the output is +DEN. What does this mean?

1 Answer



0



indices is an older GAUSS function. The first return from indices is a character vector. Character vectors were how GAUSS dealt with text way back before it had string arrays.

A character vector packs text inside of a matrix element. There is no special indication that the matrix contains text, so the standard print statement will interpret the data as floating point numeric data and you will see +DEN, because that sort of data is not valid floating point data. +DEN stands for "denormal".

To tell GAUSS to print the data in a character vector as string data, you have to prepend the data with a dollar sign. Here is an example which will work with one of the example datasets that ships with GAUSS.

// Get the file name with full path
fname = getGAUSSHome() $+ "examples/cancer.dat";

// Find the index of the variable stage
{ name, idx } = indices(fname, "stage");

print $name;
print idx;

This will code will print

  stage
 3.0000

aptech

1,773

Your Answer

1 Answer

0

indices is an older GAUSS function. The first return from indices is a character vector. Character vectors were how GAUSS dealt with text way back before it had string arrays.

A character vector packs text inside of a matrix element. There is no special indication that the matrix contains text, so the standard print statement will interpret the data as floating point numeric data and you will see +DEN, because that sort of data is not valid floating point data. +DEN stands for "denormal".

To tell GAUSS to print the data in a character vector as string data, you have to prepend the data with a dollar sign. Here is an example which will work with one of the example datasets that ships with GAUSS.

// Get the file name with full path
fname = getGAUSSHome() $+ "examples/cancer.dat";

// Find the index of the variable stage
{ name, idx } = indices(fname, "stage");

print $name;
print idx;

This will code will print

  stage
 3.0000


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy