Dear all,
Is there an easy way to delete several atoms in a molecule according to an
index list ?
RWMol RemoveAtom() can only delete one atom each time.
And after that, the index changed.
Many Thanks.
Best,
Changge
Changge Ji
Yes, go backwards through the index list.
for index in sorted(indices, reverse=True):
mol.RemoveAtom(index)
Indices are only changed if they are higher than the removed index.
Brian Kelley
> On Jun 25, 2017, at 10:16 AM, Changge Ji wrote:
>
> Dear all,
>
> Is
2 matches
Mail list logo