| | 25 | = Numeric = |
| | 26 | |
| | 27 | Rather than converting all at once, I lived for a while with a mixed Numeric/Numpy/Numarray environment. |
| | 28 | The attached module (NumNumericNumpy) makes that much easier: it gives you something close to backwards |
| | 29 | compatibility for old Numeric applications, with minimal modifications. |
| | 30 | |
| | 31 | If you replace references to {{{LinearAlgebra}}} with {{{Num.LA}}}, {{{RandomArray}}} with {{{Num.RA}}}, {{{FFT}}} with {{{Num.FFT}}}, |
| | 32 | and import the Num module instead of {{{Numeric}}}, {{{LinearAlgebra}}}, {{{RandomArray}}} and {{{FFT}}}, |
| | 33 | then many simple applications will run on both {{{Numpy}}} and {{{Numeric}}}. |
| | 34 | |
| | 35 | There are several traps, though. The default arguments for {{{Num.sum}}}, {{{Num.prod}}}, differ, |
| | 36 | so you need to explicity specify {{{axis=0}}}, instead of relying on the default. {{{numpy.nonzero}}} |
| | 37 | has a different return value, which needs to be dealt with by hand, or by enhancing {{{Num.py}}}. |
| | 38 | Note that this is merely a compatibility/porting aid, not a complete solution. |