From 62a753f245614caae8be9087763248163f604580 Mon Sep 17 00:00:00 2001 From: James Krieger Date: Wed, 20 Nov 2024 17:04:08 +0100 Subject: [PATCH] better indexing --- prody/proteins/interactions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prody/proteins/interactions.py b/prody/proteins/interactions.py index 459fa9416..697a211f3 100644 --- a/prody/proteins/interactions.py +++ b/prody/proteins/interactions.py @@ -228,7 +228,7 @@ def get_energy(pair, source): lookup = pair[0]+pair[1] try: - data_results = data[np.where(np.array(aa_pairs)==lookup)[0]][0][2:][np.where(np.array(sources)==source)][0] + data_results = data[np.nonzero(np.array(aa_pairs)==lookup)[0]][0][2:][sources.index(source)][0] except TypeError: raise TypeError('Please replace non-standard names of residues with standard names.')