Page 1 sur 1

table(matrix_obj)

Publié : sam. mars 23, 2019 2:41 am
par compsystems
Hello,
What is the procedure to create a table, from a matrix, where the first column vector is the positioning value

strList = ["one", "two", "three"]
numberList = [1, 2, 3]
array_strNum = zip( strList, numberList ) [enter] returns

[["one",1],
["two",2],
["three",3]]

table1 = table(array_strNum) [enter] returns

table(
(0,0)="one",
(0,1)=1,
(1,0)="two",
(1,1=2)... # ok, but


table2=table("one"=1,"two"=2,"three"=3) # this is what is desired

to then obtain the original matrix

unzip(table2) >

[["one",1],
["two",2],
["three",3]]

Re: table(matrix_obj)

Publié : sam. mars 23, 2019 9:36 am
par parisse
Sorry, I don't understand what kind of conversion you want to do.