datreant / datreant.data

convenient data storage and retrieval in HDF5 for Treants
http://datreant.org/
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Storing numpy array with same key as existing pandas object puts both in same directory #13

Open dotsdl opened 8 years ago

dotsdl commented 8 years ago

Storing e.g. a pandas DataFrame with:

import datreant.core as dtr
import datreant.data.attach

t = dtr.Treant('spore')

t.data['a/dataframe'] = pd.DataFrame(pd.np.random.randn(100, 3))

and then storing e.g. a numpy array with the same key

t.data['a/dataframe'] = pd.np.random.randn(100, 3)  

results in two datasets getting stored with the same name, in the same place:

> t.draw()
spore/
 +-- a/
 |   +-- dataframe/
 |       +-- pdData.h5
 |       +-- npData.h5
 +-- Treant.e3bde18c-4eca-4539-8015-9520d5768c12.json

This should not be possible using the datreant.data Limbs.