pypsa.Network.get_switchable_as_dense#
- Network.get_switchable_as_dense(component: str, attr: str, snapshots: Sequence | None = None, inds: pd.Index | None = None) pd.DataFrame #
Return a Dataframe for a time-varying component attribute with values for all non-time-varying components filled in with the default values for the attribute.
- Parameters:
n (pypsa.Network)
component (string) – Component object name, e.g. ‘Generator’ or ‘Link’
attr (string) – Attribute name
snapshots (pandas.Index) – Restrict to these snapshots rather than n.snapshots.
inds (pandas.Index) – Restrict to these components rather than n.components.index
- Return type:
pandas.DataFrame
Examples
>>> get_switchable_as_dense(n, 'Generator', 'p_max_pu')