Skip to content

Commit

Permalink
Fix new pandas warning
Browse files Browse the repository at this point in the history
  • Loading branch information
alihamdan committed Sep 19, 2023
1 parent 2333f91 commit 293c7c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion roseau/load_flow/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ def res_branches(self) -> pd.DataFrame:
"potential2": complex,
}
)
.groupby(["branch_id", "phase"]) # aggregate x1 and x2 for the same phase
.groupby(["branch_id", "phase"], observed=True) # aggregate x1 and x2 for the same phase
.mean() # 2 values; only one is not nan -> keep it
.dropna(how="all") # if all values are nan -> drop the row (the phase does not exist)
)
Expand Down

0 comments on commit 293c7c6

Please sign in to comment.