system.kanoa.utilities.convertDatasetToDict
Description
Given the name of a key column and value column, this function converts a dataset into a dictionary of key-value pairs. If valueCol is None, all data columns will be returned as values for each key. (kanoaCore).Syntax
convertDatasetToDict(data, keyCol, valueCol)- data (Dataset) - The input dataset.
- keyCol (String or list of Strings) - The name of the column to be used as a key or list of columns, e.g., 'configName' or ['configName', 'configId'].
- valueCol (String) - The name of the value column, e.g., 'configValue'.
- dictionary - A dictionary of key-value pairs.
Code Examples
python
data_dict = system.kanoa.utilities.convertDatasetToDict(data, 'configName', 'configValue')