aixd.data.utils_data.combine_formats
- aixd.data.utils_data.combine_formats(data: List[DataFrame | ndarray | List[List] | Dict | List[Dict] | torch.Tensor], format: str = 'df')[source]
Combines data into a single output and converts them into the specified target format.
The possible formats are:
“dict” : Dict (dictionary)
“dict_list” : List[Dict] (list of dictionaries)
“df_per_obj” : pd.DataFrame (dataframe where cells can contain list of values for multi-dimensional objects)
“df” : pd.DataFrame (standard dataframe flattened, all cells contain single values and column names are renamed)
“array” : np.ndarray
“torch” : torch.Tensor
“list” : List[List] (nested list)
Intended to combine, for example, data from the design parameters and performance attributes.
- Parameters:
data (List[Union[pd.DataFrame, np.ndarray, List[List], Dict, List[Dict], torch.Tensor]]) – A list of data in various types and formats.
format (str, optional, default=”df”) – Name of the target format for the returned combined data.
- Returns:
pd.DataFrame or np.ndarray or List[List] or Dict or List[Dict] or torch.Tensor – Combined data in the specified format.