Images in a dataframe are not displaying when using the display() function in Jupyter Notebooks. Here is my code which has the issue at the moment of displaying:
images = []
# Iterate through the rest of the molecules in the dataframe
for i in range(0, len(df)):
mol = df.iloc[i]['Molecule']
match = mol.GetSubstructMatch(ref_mol)
img = Draw.MolToImage(mol, highlightAtoms=match)
images.append(img)
# Add the images to the dataframe as a new column
df['Match_Image'] = images
# Display the resulting table
display(df)
I am expecting an image in the last column, instead I am getting PIL.PngImagePlugin.PngImageFile image mode=RG. in each of the cells where the images should be displayed.
Here is a screenshot of the display (last line of code and top of displayed table):
What can I do to solve this issue ? I've already tried uninstalling Pillow and re-installing.
