Re: [Pytables-users] Best way to store data that allows inserts/deletes

2012-03-21 Thread Tom Diethe
>> I'm writing a wrapper for sparse matrices (CSR format) and therefore >> need to store three vectors and 3 scalars: >> >> - data        (float64 vector) >> - indices    (int32 vector) >> - indptr      (int32 vector) >> >> - nrows      (int32 scalar) >> - ncols       (int32 scalar) >> - nnz      

[Pytables-users] Best way to store data that allows inserts/deletes

2012-03-20 Thread Tom Diethe
I'm writing a wrapper for sparse matrices (CSR format) and therefore need to store three vectors and 3 scalars: - data(float64 vector) - indices(int32 vector) - indptr (int32 vector) - nrows (int32 scalar) - ncols (int32 scalar) - nnz (int32 scalar) data and

Re: [Pytables-users] Resizing sparse matrix

2012-03-08 Thread Tom Diethe
Apologies, sent to wrong group! On 8 March 2012 16:26, Tom Diethe wrote: > I'm having trouble resizing a matrix - the set_shape function seems to > have no effect: > >>>> M > <14x3562 sparse matrix of type '' >        with 6136 stored elements in

[Pytables-users] Resizing sparse matrix

2012-03-08 Thread Tom Diethe
I'm having trouble resizing a matrix - the set_shape function seems to have no effect: >>> M <14x3562 sparse matrix of type '' with 6136 stored elements in LInked List format> >>> M.set_shape((15,3562)) >>> M <14x3562 sparse matrix of type '' with 6136 stored elements in LInked Lis

[Pytables-users] How should python dictionaries be stored in pytables?

2012-01-25 Thread Tom Diethe
I originally posted this on stackoverflow - http://stackoverflow.com/questions/9002433/how-should-python-dictionaries-be-stored-in-pytables so apologies for cross-posting, but maybe this was the better place to start. pytables doesn't natively support python dictionaries. The way I've approached

Re: [Pytables-users] Importing from Matlab's sparse format

2011-12-12 Thread Tom Diethe
Antonio Valentino tiscali.it> writes: > > Hi Tom, > > If my understanding is correct before calling csc_matrix you should > actually read data from disk > > > data = f2.root.M.data[...] > > ir = f2.root.M.ir[...] > > jc = f2.root.M.jc[...] > > Please note that f3.root.M.data in a pytables ob

[Pytables-users] Importing from Matlab's sparse format

2011-12-09 Thread Tom Diethe
I have files stored using Matlab's sparse format (HDF5, csc I believe), and I'm trying to use Pytables to operate on them directly, but haven't succeeded yet. Using h5py I can do the following: # Method 1: uses h5py (WORKS) f1 = h5py.File(fname) data = f1['M']['data] ir = f1['M]['ir'] jc = f1['M']