Output.node_result¶
- Output.node_result(node, time, asframe=True)[source]¶
For one or more nodes at one or more given times, get all attributes.
Only one of node or time can be multiple (eg. a list), not both.
- Parameters:
- node: Union[int, str, Sequence[Union[int, str]], None],
The node(s) name(s) or index(s).
- time: Union[int, str, Sequence[Union[int, str]], None],
The datetime(s) or simulation index(s).
- asframe: bool
A switch to return an indexed DataFrame. Set to False to get an array of values only, defaults to True.
- Returns:
- Union[pd.DataFrame,np.ndarray]
A DataFrame or ndarray of all attribute values nodes(s) at given time(s).
Examples
Pull all attributes at start, middle, and end time steps for a single node
>>> from swmm.pandas import Output,example_out_path >>> out = Output(example_out_path) >>> out.node_result("JUNC1",[0,out.period/2,out.period-1]) invert_depth hydraulic_head ponded_volume lateral_inflow ... flooding_losses groundwater pol_rainfall sewage datetime ... 1900-01-01 00:05:00 0.002143 1.502143 0.0 0.002362 ... 0.0 84.334671 0.000000 0.0 1900-01-01 12:05:00 8.677408 10.177408 0.0 2.665294 ... 0.0 0.260937 99.739067 0.0 1900-01-02 00:00:00 0.108214 1.608214 0.0 0.037889 ... 0.0 33.929119 66.251686 0.0 [3 rows x 9 columns]
Pull all attributes for all nodes at the start of the simulation
>>> from swmm.pandas import Output,example_out_path >>> out = Output(example_out_path) >>> out.node_result(out.nodes,'1900-01-01') invert_depth hydraulic_head ponded_volume lateral_inflow total_inflow flooding_losses groundwater pol_rainfall sewage node JUNC1 0.002143 1.502143 0.0 0.002362 0.002362 0.0 84.334671 0.0 0.000000 JUNC2 0.334742 -0.705258 0.0 0.185754 0.185785 0.0 3.935642 0.0 95.884094 JUNC3 0.000000 -3.470001 0.0 0.000000 0.000000 0.0 0.000000 0.0 0.000000 JUNC4 0.530241 -4.719759 0.0 0.657521 0.657521 0.0 5.066027 0.0 94.864769 JUNC5 0.090128 -6.409873 0.0 0.000000 0.027627 0.0 2.723724 0.0 82.198524 JUNC6 0.000000 0.000000 0.0 0.000000 0.000000 0.0 0.000000 0.0 0.000000 OUT1 0.000000 0.100000 0.0 0.000000 0.000000 0.0 0.000000 0.0 0.000000 OUT2 0.000000 -1.040000 0.0 0.000000 0.000000 0.0 0.000000 0.0 0.000000 STOR1 0.000000 -15.250000 0.0 0.000000 0.000000 0.0 0.000000 0.0 0.000000