cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
aallman
Level III

Data Table Column With Matrix Values

I have a table with a column that contains a matrix in every row. I am writing a script to search within the matrix of a specific row. However, the problem I am running into is that when I try to retrieve a value from that column it returns as " { [1, 2, 3, 4] } " instead of as a matrix. This means I cannot use the Loc() function that I need. I figured out that if I subscript the list with a 1 (as in :Col[row][1]) then I get rid of the list brackets but I am still left with the matrix as a string ( "[1, 2, 3, 4]" ) and I still cannot use it in matrix functions. 

 

What am I doing wrong and how can I get this to work???

1 ACCEPTED SOLUTION

Accepted Solutions
David_Burnham
Super User (Alumni)

Re: Data Table Column With Matrix Values

My guess is that the column has a data type of character.

You can convert the string to a list using Parse, then take the first element as a matrix:

value = " { [1, 2, 3, 4] } ";
lst = Parse(value);
show(lst);
mat = lst[1];
show(mat);
-Dave

View solution in original post

1 REPLY 1
David_Burnham
Super User (Alumni)

Re: Data Table Column With Matrix Values

My guess is that the column has a data type of character.

You can convert the string to a list using Parse, then take the first element as a matrix:

value = " { [1, 2, 3, 4] } ";
lst = Parse(value);
show(lst);
mat = lst[1];
show(mat);
-Dave

Recommended Articles