Closed forcefield closed 11 months ago
Not sure I understand the issue here, KeysView
acts the same way as a standard dict
keys, i.e. if you iterate over fp.ifp[0].keys()
you simply get the keys, it's just that it prints slightly differently in a shell (in a regular dict you wouldn't see the values like {'Hydrophobic': ({'indices': {'ligand': (3,), 'pr...
).
You can do fp.ifp[0].data.keys()
if you want to but it's more of an implementation detail than anything else. If you really need a list of keys, it's best to do list(fp.ifp[0])
, and if you only want the first key next(iter(fp.ifp[0]))
Here fp is a prolif.fingerprint.Fingerprint.
fp.ifp[0].keys() should give a list of keys. Instead, it returns a KeysView of the original dictionary. I cannot find a way to retrieve the keys at all.
e.g.
fp.ifp[0]
returnsBut
fp.ifp[0].keys()
returns