Here is the way to do it in 0.12. In 0.13, where can be an indexer (e.g. an array of locations, so this is much easier, see (Selecting using a where mask)[http://pandas.pydata.org/pandas-docs/dev/io.html#advanced-queries], then 2nd example down.
In [2]: df = DataFrame(dict(A=list(range(5)),B=list(range(5))))
In [3]: df
Out[3]:
A B
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
In [4]: store = pd.HDFStore('test.h5',mode='w')
In [5]: store.append('df',df)
Select and return a coordinate object (just a wrapped location array) according to some where
In [6]: c = store.select_as_coordinates('df', ['index<3'])
Where accepts the Coordinate objects (and you can use them with any table, here would be your 'df_action' table)
In [7]: store.select('df', where=c)
Out[7]:
A B
0 0 0
1 1 1
2 2 2
In [8]: c
Out[8]: <pandas.io.pytables.Coordinates at 0x4669590>
In [9]: c.values
Out[9]: array([0, 1, 2])
If you want to manipulate this, then just assign the positions you want to the Coordinate object before passing to select
. (As I said above, this 'hack' is going away in 0.13, and you don't need this intermediate object)
In [8]: c.values = np.array([0,1])
In [9]: store.select('df', where=c)
Out[9]:
A B
0 0 0
1 1 1
store.close()