From 4befce8ce0f036d948e97a046ce80b917ca64fd7 Mon Sep 17 00:00:00 2001 From: PauBadiaM Date: Thu, 23 Nov 2023 13:24:49 +0100 Subject: [PATCH] Fixed plot_network pandas warning --- decoupler/plotting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decoupler/plotting.py b/decoupler/plotting.py index ddde15b..b49a358 100644 --- a/decoupler/plotting.py +++ b/decoupler/plotting.py @@ -1720,7 +1720,7 @@ def get_target_idxs(n_targets, obs, net, by_abs): elif isinstance(n_targets, list): t_idx = np.isin(net['target'].astype(str), n_targets) elif isinstance(n_targets, int): - net['prod'] = [obs.loc[:, t][0] * w if t in obs.columns else 0 for t, w in zip(net['target'], net['weight'])] + net['prod'] = [obs.iloc[0][t] * w if t in obs.columns else 0 for t, w in zip(net['target'], net['weight'])] if by_abs: net['prod'] = abs(net['prod']) t_idx = (