From: <ro...@ho...> - 2000-07-04 07:59:52
|
Hm. I found a bug in one of my programs that was due to the difference in behavior between a 'f' shape () array and a true python scalar: import Numeric a=Numeric.zeros((50,50),'f') b=[] for i in range(50): d=a[i,i] b.append(d) nb=Numeric.array(b) print nb.shape # Expect (50,) but get (50,1) BTW: Why does "a=Numeric.zeros((50,),'f'); d=a[i]" return a python scalar, and the above script a shape () array? Rob -- ===== ro...@ho... http://www.hooft.net/people/rob/ ===== ===== R&D, Nonius BV, Delft http://www.nonius.nl/ ===== ===== PGPid 0xFA19277D ========================== Use Linux! ========= |