Tools for index conversions

This module manages the conversion of indices between different formats, e.g. Cnode IDs, Full Callpath and Short Callpath.

Short Callpath means the name of the function followed by the Cnode ID, separated by comma.

index_conversions.convert_index(df, tree_df, target=None)

Converts the the index of a DataFrame to Short Callpath, Full Callpath or Cnode ID.

Parameters
  • df (pandas.DataFrame) – DataFrame where the conversion needs to happen

  • tree_df (pandas.DataFrame) – DataFrame representation of the call tree, which contains the information for the translation.

  • target (str) – Can be Short Callpath, Full Callpath, Cnode ID or None.

Returns

res – A DataFrame identical to df, but with a different index.

Return type

pandas.DataFrame