numeric-matrix
  • 27 Jul 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

numeric-matrix

  • Dark
    Light
  • PDF

Article summary

The numeric-matrix parser will load data from multiple rows and columns from a source data table into numeric variables within collections.

It inherits attributes and data loading behaviors from the abstract matrix parser type.

Example

{
  "parser_type": "numeric-matrix",
  "collection": "collection_name",
  "variable": "variable_name,
  
  // The parser does all the work to load the data into a single
  // collection with multiple variables. These will then be converted
  // into a matrix in post-processing.
  "parser": {
    "parser_type": "numeric-row",
    "variable": {
      "parser_type": "categorical",
      "column": "row_header_column_name"
    }
  }
}

Attribute - use_float

The use_float attribute is optional. It will default to false.

{
  "parser_type": "numeric-matrix",
  "collection": "collection_name",
  "variable": "variable_name,
  "parser": {...},
  
  // When this flag is set, 32-bit floats will be used
  // to store numeric values instead of 64-bit doubles.
  "use_float": true
}

Attribute - compress

The compress attribute is optional. It will default to dense.

{
  "parser_type": "numeric-matrix",
  "collection": "collection_name",
  "variable": "variable_name,
  "parser": {...},
  
  // This will enforce a sparse representation of the matrix
  // in memory.
  "compress": "sparse"
}

Attribute - null_value

The null_value attribute is optional. It will default to NaN.

{
  "parser_type": "numeric-matrix",
  "collection": "collection_name",
  "variable": "variable_name,
  "parser": {...},
  
  // Null value will define the default value to use when data
  // is missing for entities.
  "null_value": 0
}

Was this article helpful?

What's Next