sleepless.utils.utils_fig_table_df#

Concatenate and save a list of figure or table.

Functions

create_df(subset, attributes, bins)

Create a dataframe from a list of Samples and for a list of attributes, if "age" is in attribute, a new column "ageGroup" is added to the dataframe which assign an ageGroup to the patient.

make_rst_tabulate(name, table[, ...])

Create Rst table from pandas.DataFrame.

save_fig(out_path, fig_list[, name])

rtype:

None

save_tables(out_path, tables[, name])

sleepless.utils.utils_fig_table_df.create_df(subset, attributes, bins)[source]#

Create a dataframe from a list of Samples and for a list of attributes, if “age” is in attribute, a new column “ageGroup” is added to the dataframe which assign an ageGroup to the patient.

For the creation of “ageGroup” column bins has to be a list of int which define the different categories of age.

Parameters:
  • subset (list[DelayedSample]) – a list of Samples

  • attributes (list[str]) – a list of attribute which are attribute of Samples

  • bins (list[int]) – definition of the age categories

Return type:

DataFrame

sleepless.utils.utils_fig_table_df.make_rst_tabulate(name, table, min_column_width=0)[source]#

Create Rst table from pandas.DataFrame.

Parameters:
  • name (str) – title of the table

  • table (DataFrame) – dataframe to be tabulate and save

  • min_column_width (int) – fixed a minimum column width

sleepless.utils.utils_fig_table_df.save_fig(out_path, fig_list, name='plot')[source]#
Return type:

None

sleepless.utils.utils_fig_table_df.save_tables(out_path, tables, name='tables')[source]#