networkcommons.utils.targetlayer_formatter

networkcommons.utils.targetlayer_formatter(df, n_elements=25, act_col='stat')

Format dataframe to be used by the network methods. It converts the df values to 1, -1 and 0, and outputs a dictionary.

Parameters:
  • df (DataFrame) – A pandas DataFrame.

  • n_elements (int) – The number of elements to be selected.

  • act_col (str) – The column containing the activity scores

Returns:

sign}

Return type:

A dictionary {target