How to retrieve the row/column names of a matrix in DolphinDB?

15 Views Asked by At

The row names of matrix b are of DATE type, how to retrieve the row names?

m=matrix(1..5, 11..15)
m.rename!(2020.01.01..2020.01.05, `A`B) //
m.setIndexedMatrix!()


           A B
           - --
2020.01.01|1 11
2020.01.02|2 12
2020.01.03|3 13
2020.01.04|4 14
2020.01.05|5 15
1

There are 1 best solutions below

0
Claire On

You can use the function rowNames/colNames to retrieve the row/column names of a matrix, as shown below:

m.rowNames()
[2020.01.01,2020.01.02,2020.01.03,2020.01.04,2020.01.05]
m.colNames()
["A","B"]