Hi there,

I am trying to figure out a simple way to remove data from a HDF5 when
it matches certain criteria (analogous to SQL 'delete from table where
= %s'.  I am probably being stupid, but I cannot find a
straightforward way to do this!  I couldn't see anyway to do this in
the tutorial, except for using the row numbers directly.

So far I have done the following:

        rows2delete = []
        for thisid in idlist:
            rows = [x.nrow for x in table.where('id==%r' %thisid)]

            rows2delete+=rows
        print 'todelete', rows2delete
        for r in rows2delete:
            print 'r', r
            table.removeRows(r)


This always crashes thus:

  File 
"/bio/shared/auxsoft/python-2.5.2/lib/python2.5/site-packages/tables/table.py",
line 2129, in removeRows
    (start, stop, step) = self._processRangeRead(start, stop, 1)
  File 
"/bio/shared/auxsoft/python-2.5.2/lib/python2.5/site-packages/tables/leaf.py",
line 459, in _processRangeRead
    "number of rows (%s)" % (start, nrows) )
IndexError: start of range (7545) is greater than number of rows (7544)


as though the removeRows(r) was removing all data after r....

has any one come across and fixed this? Or know what's going on?

Thanks

Toby

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to