reportcompiler_ic_tools.tables¶
This module contains helper functions to create tables with the Information Centre data.
Functions¶
generate_table_data(): Generates a new dataframe with the markers corresponding to the defined
-
reportcompiler_ic_tools.tables.generate_table_data(data_dict, selected_columns=None, column_names=None, row_id_column=None, format='latex')¶ - Generates a new dataframe with the markers corresponding to the defined
- references (sources, notes, …), alongside a list of the markers’ meaning.
Parameters: - data_dict (dict) – Dictionary returned by the IC data fetcher
- selected_columns (list) – List with the column names to be selected from the original dataframe
- column_names (list) – List with the column names of the selected dataframes
- row_id_column – Column name that will contain the marks for row references
- format (str) – Format that the returned dataframe should comply with
Returns: Tuple (data, columns, references), where data is the original dataframe with the necessary reference markers, columns is the list with the table columns as will be displayed and references is a nested structure: for each type (sources, notes, …) there is a list of dictionaries with each (‘marker’ key) and associated reference (‘text’ key).
Return type: tuple (dataframe, list, dict)