You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Demand_patterns/wntr_utils.py
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -0,0 +1 @@
1
+
# includesimport pandas as pddef get_demand_patterns_from_nodes(wn, index=0): df_pat = pd.DataFrame(columns = wn.junction_name_list) for name, j in wn.junctions(): try: base = j.demand_timeseries_list[index].base_value pat = j.demand_timeseries_list[index].pattern if pat is not None: df_pat.loc[:,name] = base * pat.multipliers except IndexError: print('Index Error excepted') return df_pat.dropna(axis=1)
0 commit comments