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 arrayBigArrayarrayVector
pair 3:5; 'a':'c'; "Tom":"John"pair
matrix 1..6$2:3 or reshape(1..6, 2:3)matrix: matrixindexed matrix: setIndexedMatrix!indexed series: indexedSeries / setIndexedSeries!
set set
dictionary dict
table in-memory table: tableDFS table: createPartitionedTableindexed table: indexedTablekeyed table: keyedTablestream table: streamTablehigh-availability stream table: haStreamTablemvcc 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