Hello Kale,

This is actually pretty easy.  You should look at the where() method on
tables (
http://pytables.github.com/usersguide/libref.html?#tables.Table.where).
 This will give you an iterator that then you can stick in a new table.

In psuedocode:

mask = table1.where('x<y')
table2 = file.createTable(...)
table2.append(mask)

Let us know if you have problems.

Be Well
Anthony

On Fri, Mar 2, 2012 at 3:46 PM, Kale Franz <eet...@gmail.com> wrote:

> Greetings!
>
> My question concerns creating a new table from "filtered" rows of another
> table.  That is, given a certain query parameter (e.g. 'x>y', etc), how do
> I create a new table from the returned values?
>
> The question arises because of this comment in the documentation:
>
> Table.removeRows() is the method used for deleting rows in PyTables.
> However, it is very simple (only contiguous blocks of rows can be deleted)
> and quite inefficient, and one should consider whether dumping
> filtered data from one table into another isn't a much more convenient
> approach.
>
> However, I am unable to find documentation on how to implement this.
>
> Any help would be greatly appreciated.
>
> Best,
> Kale
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Pytables-users mailing list
> Pytables-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pytables-users
>
>
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to