Skip to content

Commit bf2fe66

Browse files
committed
Also check for +/-inf
1 parent 3d43ae4 commit bf2fe66

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

depmap_analysis/network_functions/net_functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,8 @@ def add_corr_to_edges(graph: DiGraph, z_corr: pd.DataFrame,
393393
for u, v, data in tqdm(graph.edges(data=True)):
394394
un = u[0] if isinstance(u, tuple) else u
395395
vn = v[0] if isinstance(v, tuple) else v
396-
if un in z_corr and vn in z_corr and not np.isnan(z_corr.loc[un, vn]):
396+
z_sc = z_corr.loc[un, vn]
397+
if un in z_corr and vn in z_corr and not np.isnan(z_sc) and not np.isinf(z_sc):
397398
z_sc = z_corr.loc[un, vn]
398399
data['z_score'] = round(z_sc, 4)
399400
data['corr_weight'] = round(z_sc_weight(z_sc, self_corr), 4)

0 commit comments

Comments
 (0)