This reminds me of two issues related to DataFrame attributes
a)
df = pd.DataFrame(random.randn(20,4), columns=list('ABCD'))
df['name'] = df['A'] #someone adds a column for names
df.name = 'bastar' #attach a name unsuspectingly
df['name'] is now a column, obliterated by the string 'bastar'
df.name is the same
b)
In [11]: df.metastuff = {1: 'a', 'X': [1,2,3,4]}
In [12]: df.metastuff
Out[12]: {1: 'a', 'X': [1, 2, 3, 4]}
In [13]: st = pd.HDFStore('/tmp/attributes_test.ph5', 'w')
In [14]: st['df'] = df
In [15]: st.close()
In [16]: st = pd.HDFStore('/tmp/attributes_test.ph5', 'r')
In [17]: st['df'].metastuff
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-17-be4933f58476> in <module>()
----> 1 st['df'].metastuff
/home/x/Local/Envs/test/lib/python2.7/site-packages/pandas/core/frame.pyc
in __getattr__(self, name)
1769 return self[name]
1770 raise AttributeError("'%s' object has no attribute '%s'" %
-> 1771 (type(self).__name__, name))
1772
1773 def __setattr__(self, name, value):
AttributeError: 'DataFrame' object has no attribute 'metastuff'
HDF5 attributes are limited to 64kb but there must be a way to keep
some pieces of valuable metadata together with the Pandas objects when
serializing.
-á.
> --
>
>