Skip to content

Commit

Permalink
Update overall_tools.py
Browse files Browse the repository at this point in the history
fix TypeError: ufunc 'isnan' not supported for the input types. error
  • Loading branch information
koen-swaerts authored and matthdsm committed Aug 28, 2024
1 parent bec9544 commit 4d3a68d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wisecondorx/overall_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import math

import numpy as np
import pandas as pd

"""
Scales the bin size of a sample.npz to the one
Expand Down Expand Up @@ -104,7 +105,7 @@ def get_z_score(results_c, results):
segment_w = results_w[segment[0]][segment[1] : segment[2]]
segment_w = [segment_w[i] for i in range(len(segment_w)) if segment_rr[i] != 0]
null_segments = [
np.ma.average(np.ma.masked_array(x, np.isnan(x)), weights=segment_w)
np.ma.average(np.ma.masked_array(x, pd.isnull(x)), weights=segment_w)
for x in np.transpose(segment_nr)
]
null_mean = np.ma.mean([x for x in null_segments if np.isfinite(x)])
Expand Down

0 comments on commit 4d3a68d

Please sign in to comment.