shunwang / numexpr

Automatically exported from code.google.com/p/numexpr
MIT License
0 stars 0 forks source link

multidimensional output #85

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is an enhancement request.

I frequently need to create multidimensional histograms from data stored in 
PyTables, usually of variables computed from the various columns of the table.  
tables.Expr is a very natural way to do this, but it is a bit cumbersome for 
multiple dimensions and I expect could be more efficient.  For instance:

histdata = array([ tables.Expr("col1_2", vars(mytable.cols)), tables.Expr("col2 * (col3 + col4) \ exp(col1_(3.84/400.))", vars(mytable.cols)) tables.Expr("col5", vars(mytable.cols))]) hist, edges = histogramdd(histdata.T)

It would be really great, reducing either typing or code complexity, if I could 
instead generate a 2-dimensional array from just one numexpr call, like:

histdata = tables.Expr("[col1*2, col2 \ (col3+col4), col5]", vars(mytable.cols)) hist, edges = histogramdd(histdata.T)

And I suspect that this would be more efficient as well.
Regards,
Jon

Original issue reported on code.google.com by jsw....@gmail.com on 5 Jun 2012 at 8:59