I have an externally defined module which has a number of methods in it. I can get all the methods as a list with dir() like print(dir[Descriptors]) and I get a list ['BalabanJ', 'BertzCT',...]. Now I want to apply all the methods on a list of values [x1, x2, ...]. If I directly use Descriptors.BalabanJ(x1) it works. However, I want to do them in a loop like
from rdkit.Chem import Descriptors
for i in dir[Descriptors]:
for x in [x1,x2,x3]:
print(Descriptors.i(x))
, it says that Descriptors does not have method i in it. How can I implement this?
'BalabanJ'and.BalabanJ(). The first one is string while the latter is a function