pypowsybl.network.Network.create_substations

Network.create_substations(df=None, **kwargs)[source]

Creates substations.

Parameters:
  • df (DataFrame | None) – Attributes as a dataframe.

  • kwargs (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]) – Attributes as keyword arguments.

Return type:

None

Notes

Data may be provided as a dataframe or as keyword arguments. In the latter case, all arguments must have the same length.

Valid attributes are: - id: the identifier of the substation - name: an optional human readable name for the substation - country: an optional country code (‘DE’, ‘IT’, …) - TSO: an optional TSO name

Examples

Using keyword arguments:

network.create_substations(id='S-1', country='IT', TSO='TERNA')

Or using a dataframe:

stations = pd.DataFrame.from_records(index='id', data=[
    {'id': 'S1', 'country': 'BE'},
    {'id': 'S2', 'country': 'DE'}
])
network.create_substations(stations)