arthurai.core.util.dataframe_like_to_list_of_dicts#

arthurai.core.util.dataframe_like_to_list_of_dicts(data)#

Standardize data in a List of Dicts format (e.g. [{‘a’: 1, ‘b’: 2}, {‘a’: 3, ‘b’: 4}]). Input can be formatted as a List of Dicts, Dict of Lists (e.g. {‘a’: [1, 3], ‘b’: [2, 4]}), or a Pandas DataFrame. May return the same object as input if it already matches the correct format. :type data: Union[List[Dict[str, Any]], Dict[str, List[Any]], DataFrame] :param data: the input data to format :return: the data restructured as a Dict of Lists :raises UserTypeError: if the data is in an unexpected format