Hi Chris, I think you can do it with SaveXlsxFromFrame. http://rdkit.org/docs/source/rdkit.Chem.PandasTools.html#SaveXlsxFromFrame
rdkit.Chem.PandasTools.SaveXlsxFromFrame(*frame*, *outFile*, *molCol='ROMol'*, *size=(300, 300)*, *formats=None*)¶ <http://rdkit.org/docs/source/rdkit.Chem.PandasTools.html#rdkit.Chem.PandasTools.SaveXlsxFromFrame> Saves pandas DataFrame as a xlsx file with embedded images. molCol can be either a single column label or a list of column labels. It maps numpy data types to excel cell types: int, float -> number datetime -> datetime object -> string (limited to 32k character - xlsx limitations) The formats parameter can be optionally set to a dict of XlsxWriter formats (https://xlsxwriter.readthedocs.io/format.html#format), e.g.: { ‘write_string’: {‘text_wrap’: True} } Currently supported keys for the formats dict are: ‘write_string’, ‘write_number’, ‘write_datetime’. Cells with compound images are a bit larger than images due to excel. Column width weirdness explained (from xlsxwriter docs): The width corresponds to the column width value that is specified in Excel. It is approximately equal to the length of a string in the default font of Calibri 11. Unfortunately, there is no way to specify “AutoFit” for a column in the Excel file format. This feature is only available at runtime from within Excel. Thanks, Taka 2024年2月22日(木) 19:19 Chris Swain via Rdkit-discuss < rdkit-discuss@lists.sourceforge.net>: > Hi, > > Is it possible to export from a Pandas data frame to Excel, inserting the > structures as images in the excel sheet? > > Cheers > > Chris > > _______________________________________________ > Rdkit-discuss mailing list > Rdkit-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss