From: <ro...@ho...> - 2000-05-05 21:13:20
|
I have to admit that today I have been bitten by NumPy's copy/pointer and 0-order array inconsistency a bit. Easy enough to fix, but a nice catch for somebody new to NumPy: try: a=Numeric.array([1,2,3]) a[0],a[1]=a[1],a[0] print a vs: a=Numeric.array([[1,2,3],[4,5,6],[7,8,9]]) a[0],a[1]=a[1],a[0] print a Regards, Rob Hooft. -- ===== ro...@ho... http://www.xs4all.nl/~hooft/rob/ ===== ===== R&D, Nonius BV, Delft http://www.nonius.nl/ ===== ===== PGPid 0xFA19277D ========================== Use Linux! ========= |