system.kanoa.utilities.convertDatasetRowToJSON
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)- data: PyObject - dataset or PyDataset
- rowIndex: PyObject - index of the row to be converted to JSON
- 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)