edisgo.tools.networkx_helper

Module Contents

Functions

translate_df_to_graph(→ networkx.Graph)

Translate DataFrames to networkx Graph Object.

edisgo.tools.networkx_helper.translate_df_to_graph(buses_df: pandas.DataFrame, lines_df: pandas.DataFrame, transformers_df: DataFrame | None = None) networkx.Graph[source]

Translate DataFrames to networkx Graph Object.

Parameters
  • buses_df (pandas.DataFrame) – Dataframe with all buses to use as Graph nodes. For more information about the Dataframe see buses_df.

  • lines_df (pandas.DataFrame) – Dataframe with all lines to use as Graph branches. For more information about the Dataframe see lines_df

  • transformers_df (pandas.DataFrame, optional) – Dataframe with all transformers to use as additional Graph nodes. For more information about the Dataframe see transformers_df

Returns

Graph representation of the grid as networkx Ordered Graph, where lines are represented by edges in the graph, and buses and transformers are represented by nodes.

Return type

networkx.Graph