turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Data Table Column With Matrix Values

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

May 4, 2017 8:52 AM
(701 views)

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

May 4, 2017 9:20 AM
(1320 views)

Solution

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

1 REPLY

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

May 4, 2017 9:20 AM
(1321 views)

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