[PYTHON MATRIX-SIG] Re: Newbie questions about NumPy under PythonWin

Christian Tismer tismer@tismer.com
Mon, 20 Jan 1997 21:17:33 +0100


> >The NumPy version for PythonWin is AFAIK a bit outdated but working
> >well.
> 
> What is out of date? How hard is it to update from the current NumPy
> sources? The NumPy web page is not very clear on what to do for the Win32
> platform.
Mark Hammond says he is unable to support all other packages and does
not include NumPy. So I had to keep with the last version which is in
Python win delivery b4 and b5. b6 is without, and not so stable by now.

If you have the MS c compiler which Mark uses, you can try to build it.
I don't know if this is difficult, at least it is a welcome 
contribution ;^)

> 
> >It relies on the ni module, at least in PythonWin b4 and b5.
> >So try import ni, Numeric
> >Import * does not work because you cannot import * from a package.
> 
> import ni, Numeric did not work.
Look at your PythonPath, it should contain NumPy by default. If not,
then you had something wrong at installation time.
The registry contains a key for every package that gets its own path.
You might watch it with regedit:
HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\1.4.0\PythonPath
It must contain a key "Numeric" and a 
standard value of e.g. "E:\Python\NumPy"
Look for the others there and do it analoguous.
If you don't have registry entries at all, then you have a totally
outdated Pythonwin. _do_ _not_ use any binaries from the Pysthon
CD-s, they are definately out of date.

> import ni; import NumPy.Numeric did work, but this leads to some unwieldy
> constructs like:
> 
> x = NumPy.Numeric.array([5,6,4,3,3])
Despite the above, it would not hurt to say
Numeric = NumPy.Numeric
x = Numeric.array([1,2,3])
> 
> Also, with this approach, I couldn't figure out how to access the MLab.py
> routines.

This one works:
import ni, Numeric
from Numeric import FFT

The same does not work for (this version of) MLab, because it falsely
includes "from Numeric import *" which is again not ok for "ni".
You might change that or look for another version. I think this was
in an early state.

ok? 

- chris

_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________