Commit 64602dd7 authored by connor.hainje@pnnl.gov's avatar connor.hainje@pnnl.gov
Browse files

Silence warning when df is zero length in compute blame

parent 2ac70dfb
......@@ -130,7 +130,8 @@ def compute_blame_numbers(df):
def compute_blame(df):
nums = compute_blame_numbers(df)
top = np.argmax(nums)
return top, nums[top] / len(df)
frac = nums[top] / len(df) if len(df) > 0 else np.nan
return top, frac
def compute_blame_in_all_bins(df):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment