memorandum/PandasTools

RDKit has a method called PandasTools that can use molecules object as PandasDataFrame.
It is quite powerful method I think.
I got following error yesterday.

from rdkit import Chem
from rdkit.Chem import PandasTools
df = PandasTools.LoadSDF("testset.sdf")
df

....
--> 131 formatter = pd.core.format.DataFrameFormatter(self,buf=None,columns=None,col_space=None,colSpace=None,header=True,index=True,
132 na_rep='NaN',formatters=None,float_format=None,sparsify=None,index_names=True,
133 justify = None, force_unicode=None,bold_rows=True,classes=None,escape=False)
AttributeError: module 'pandas.core' has no attribute 'format'
...

I could not solve the problem, but member of RDKit user group gave me advise, the problem was depend on pandas.
My pandas was version 0.18.1 and the “format” module got moved from pandas.core to pandas.formats.

So to fix the problem, change version is the easiest way.
I reinstalled pandas 0.18.0 instead of 0.18.1. And All worked fine. 😉

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s