utils

Miscellaneous utility functions used in other modules.

bigbang.utils.add_freq(idx, freq=None)

Add a frequency attribute to idx, through inference or directly.

Returns a copy. If freq is None, it is inferred.

bigbang.utils.clean_message(mess)
bigbang.utils.get_common_foot(str1, str2, delimiter=None)
bigbang.utils.get_common_head(str1, str2, delimiter=None)
bigbang.utils.get_paths_to_dirs_in_directory(directory: str, folder_dsc: str = '*') → List[str]

Get paths of all directories matching file_dsc in directory

bigbang.utils.get_paths_to_files_in_directory(directory: str, file_dsc: str = '*') → List[str]

Get paths of all files matching file_dsc in directory

bigbang.utils.labeled_blockmodel(g, partition)

Perform blockmodel transformation on graph g and partition represented by dictionary partition. Values of partition are used to partition the graph. Keys of partition are used to label the nodes of the new graph.

bigbang.utils.remove_quoted(mess)
bigbang.utils.repartition_dataframe(df, partition)

Create a new dataframe with the same index as argument dataframe df, where columns are the keys of dictionary partition. The data of the returned dataframe are the combinations of columns listed in the keys of partition