[PYTHON MATRIX-SIG] NumericalPython

Kevin Maguire K.Maguire@dl.ac.uk
Fri, 30 Aug 1996 20:14:10 +0100 (BST)


Hi

When I requested the archive for this SIG I only received messages up
until the end of May, why is this ??  Has nothing been posted since
then ???

Okay, I ftp'd and installed python1.4beta3 and NumPy-1.0a2 (which took
a bit of finding) on my DEC Alpha running V3.0 of OSF1 (now renamed
Digital Unix).  The core python installation went reasonably smoothly,
and I followed the instructions in INSTALL and Makefile.pre.in to add
the Numerical support (why no make install in this package ?? ).

However running the tests gives an error:

% ../python -iv test_all.py
...
...
...
array([[1, 66], [66, 12]], 'l')
array([0, 1, 2, 3, 4, 5], 'l')
TypeError: compare not supported for type
Traceback (innermost last):
  File "test_all.py", line 42, in ?
    test_lines(fp.readlines())
  File "test_all.py", line 22, in test_lines
    raise ValueError, "%s doesn't match expected %s" % (last_out,
line[1:-1])
ValueError: TypeError: compare not supported for type doesn't match
expected array([5, 3, 1, 0, 4, 2], 'l')

I don't really know this is about.  I went on and installed anyway,
copying the .py files Lib/* to /usr/local/lib/python1.4/numeric/
(which 'strings python' told me was built into the executable
somewhere, I missed any documentation that explained what to do to
'install' the new enhanced (?) python?

I then ran through the tutorial:  

http://maigret.cog.brown.edu/Python/Documentation/arraytut.html

Some things work, others don't.  For example:

>>> from Numeric import *
>>> x,y,z = 1,2,3
>>> a = array([x,y,z])
>>> a
1 2 3
>>> a = array([x,y,z], Float())
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: call of non-function
>>> 

and 

>>> ma = array([[1,2,3],[4,5,6],[7,8,9]])
>>> ma
1 2 3
4 5 6
7 8 9
>>> ma.shape
(3, 3)
>>> flattened_ma = ma.reshape(9)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
AttributeError: reshape
>>> 

Several other functions didn't work properly, zeros, ones, etc being
examples.  So either I've done something wrong in the install, or I'm
missing something.  Please enlighten me ....

Cheers
Kevin
--
Kevin Maguire         __    __    __    __           Daresbury Laboratory
K.Maguire@dl.ac.uk   /  \  /  \  /  \  /  \      Warrington, Cheshire, UK
____________________/  __\/  __\/  __\/  __\_____________________________
___________________/  /__/  /__/  /__/  /________________________________
                   | / \   / \   / \   / \  \____   voice: (01925) 603221
                   |/   \_/   \_/   \_/   \    o \    FAX: (01925) 603634
                                           \_____/--<                    


=================
MATRIX-SIG  - SIG on Matrix Math for Python

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