straph.utils package

Module contents

straph.utils.dataframe_to_latex_landscape(df, latex_output_path, title=None, highlight_best_result=False)[source]

Take a pandas DataFrame and output a latex table. Requirements : latex, pdflatex

Parameters
  • highlight_best_result

  • df – A Pandas DataFrame (of a reasonable size, nb of columns).

  • latex_output_path – Path to write the corresponding LaTeX table.

  • title – Title of the output LaTeX table.

Returns

straph.utils.get_cmap(N, cmap='nipy_spectral')[source]

Returns a function that maps each index in 0, 1, … N-1 to a distinct RGB color.

Parameters
  • N – The size of the desired colormap

  • cmap – The name of a `matplotlib colormap.

Returns

A normalized colormap for N values

straph.utils.hist_plot(data, bins=30, fontsize=28, alpha=0.7, ylog=False, ax=None, legend=False, xlabel='', color=None)[source]
straph.utils.nx_degree(G)[source]
straph.utils.plot_adjacency_list(S, a_l, label=True)[source]

Plot the current adjacency list adj_list.

Parameters
  • label

  • S – A stream graph (we get its labels)

  • a_l – an adjacency list

Returns

Plot of adjacency list

straph.utils.profile_shit(sf, snakeviz=False)[source]