Data Forms

DolphinDB has the following data forms:

Data Form Name Example
scalar 5, 1.3, 2012.11.15, `hello
vector 5 4 8 or [5, 4, 8], array, BigArray,
pair 3:5; 'a':'c'; "Tom":"John", pair
matrix 1..6$2:3 or reshape(1..6, 2:3). matrix: matrix; indexed matrix: setIndexedMatrix!; indexed series: indexedSeries / setIndexedSeries!
set set
dictionary dict
table in-memory table: table; DFS table: createPartitionedTable; indexed table: indexedTable; keyed table: keyedTable; stream table: streamTable; high-availability stream table: haStreamTable; mvcc table: mvccTable

Use function form to get the data form ID of a variable or constant.

form false;
// output
0
form `TEST;
// output
0

form `t1`t2`t3;
// output
1
form 1 2 3;
// output
1

x= 1 2 3
if(form(x) == VECTOR){y=1};
y;
// output
1

form 1..6$2:3;
// output
3

form(tensor(1..10$5:2))
// output: 10