Skip to content

Commit

Permalink
refactor: series from dict
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman authored and Simon Brugman committed Jun 23, 2021
1 parent 47411ff commit 8299110
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions popmon/alerting/compute_tl_bounds.py
Expand Up @@ -42,11 +42,9 @@ def traffic_light_summary(row, cols=None, prefix=""):
:param list cols: list of cols to calculate traffic light summary of (optional)
:param str prefix: prefix of traffic light columns, in case cols is empty. default is ``"tl_"``
"""
x = pd.Series()
x["worst"] = np.nan
x["n_red"] = np.nan
x["n_yellow"] = np.nan
x["n_green"] = np.nan
x = pd.Series(
{"worst": np.nan, "n_red": np.nan, "n_yellow": np.nan, "n_green": np.nan}
)

if cols is None or len(cols) == 0:
# if no columns are given, find traffic light columns for which summary is made.
Expand Down

0 comments on commit 8299110

Please sign in to comment.