Skip to main content

system.kanoa.utilities.convertDatasetRowToJSON

This function requires KanoaCore module

Description

Takes a dataset or pyDataset and converts the first row to json. If no rows are found, it creates json with null for values.

Syntax

convertDatasetRowToJSON(data, rowindex)
  • Parameters
      data: PyObject - dataset or PyDataset
      rowIndex: PyObject - index of the row to be converted to JSON
  • Returns
      Dictionary, with the data's column names as keys, and the row's values as values
  • Code Examples

    # This returns the first line of JSON list of the data entered in col1 and col2

    data = system.dataset.toDataSet(["col1","col2"], [[1,2]])
    system.kanoa.utilities.convertDatasetRowToJSON(data, 0)