pypsa.Network.investment_periods

pypsa.Network.investment_periods#

property Network.investment_periods: Index#

Periods level of snapshots dimension.

If snapshots is single indexed, periods will always be empty, since there no investment periods without timesteps are defined. Otherwise only the period level will be returned.

Note

Alias for pypsa.Network.periods().

Returns:

Investment periods of the network.

Return type:

pd.Index

See also

[pypsa.Network.snapshots][] : Get the snapshots dimension. [pypsa.Network.periods][] : Get the snapshots dimension. [pypsa.Network.timesteps][] : Get the timestep level only.

Examples

>>> n = pypsa.Network()
>>> n.add("Bus", "bus") 
>>> n.snapshots = pd.date_range("2015-01-01", freq="h", periods=3)
>>> n.snapshots
DatetimeIndex(['2015-01-01 00:00:00', '2015-01-01 01:00:00',
               '2015-01-01 02:00:00'],
              dtype='datetime64[ns]', name='snapshot', freq='h')

Add investment periods: >>> n.investment_periods = [1, 2] >>> n.investment_periods Index([1, 2], dtype=’int64’, name=’period’)

Which will also cast snapshots to a MultiIndex: >>> n.snapshots MultiIndex([(1, ‘2015-01-01 00:00:00’),

(1, ‘2015-01-01 01:00:00’), (1, ‘2015-01-01 02:00:00’), (2, ‘2015-01-01 00:00:00’), (2, ‘2015-01-01 01:00:00’), (2, ‘2015-01-01 02:00:00’)],

name=’snapshot’)