<p>It is easily done with RDKit:</p>
<pre><code>from rdkit.Chem import PandasTools

fn = '/mypath/dataset.sdf'

df = PandasTools.LoadSDF(fn, embedProps=True, molColName=None, smilesName='smiles')
</code></pre>

CC BY-SA 4.0
2021-02-05T00:22:57.377Z
2021-02-05T00:22:57.377Z
Soerendip
<p>What is the best python tool to convert a SDF file to a structured data frame (pandas.DataFrame). Similar to Molconvert from ChemAxon? SDF can have different datafields for each compound which I would like to have in a dataframe. The 2D or 3D structures can be disregarded.</p>

CC BY-SA 4.0
2021-02-05T00:13:39.777Z
Please provide a small example file
Liam McIntyre
<python><rdkit>
How to convert a SDF molecular structure file to a pandas dataframe with Python?
# How to convert a SDF molecular structure file to a pandas dataframe with Python?

(Asked by: username_0 on 2021-02-04)

What is the best python tool to convert a SDF file to a structured data frame (pandas.DataFrame). Similar to Molconvert from ChemAxon? SDF can have different datafields for each compound which I would like to have in a dataframe. The 2D or 3D structures can be disregarded.

**Tags:** python, rdkit
> **Comments:**
> **username_1**: Please provide a small example file  

---

## 1 answers

### Answer by username_0 on 2021-02-05. Score: 2 | Accepted answer

It is easily done with RDKit:
from rdkit.Chem import PandasTools

fn = '/mypath/dataset.sdf'

df = PandasTools.LoadSDF(fn, embedProps=True, molColName=None, smilesName='smiles')


---

