Dear list,

I ran into the following.

If you multiply a 10-element pytables array with a 1-element NumPy array using
tables.expr, then the return value has length one. If you do the same  
in pure NumPy, the
return value has length 10.

I pasted a small script below shows this.

Is this is expected or not?

Best, Gabriel

Script:
+++++++


import tables as tb
import numpy as np

f = tb.openFile('test.h5', 'a')

factor = np.array([3.])
ar = np.arange(10.)

# PyTables
ar = f.createArray(f.root, 'test1', ar)
e = tb.Expr('factor*ar')
print e.eval() # [ 0.]

# NumPy
print factor*ar # [  0.   3.   6.   9.  12.  15.  18.  21.  24.  27.]

f.close()




------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to