2d array slicing problem

jepler at unpythonic.net jepler at unpythonic.net
Fri Oct 7 15:01:44 EDT 2005


Do you have a simple program that demonstrates the problem?

I have an x86 machine with Python 2.3, and an x86_64 machine with Python 2.4
available.  I wrote a simple test program which performs a slice operation,
but it behaves the same on both platforms.

Here's the program:
#------------------------------------------------------------------------
import numarray, sys, os
print "python:  ", sys.version_info 
print "numarray:", numarray.__version__
print "CPU:     ", os.uname()[-1]

n = numarray.arange(10)
o = numarray.outerproduct(n,n)
p = o[3:7,6:10].copy()
q = numarray.outerproduct([3,4,5,6], [6,7,8,9])
print "Success: ", numarray.alltrue(p.ravel() == q.ravel())
#------------------------------------------------------------------------

Here are the two results I gathered:

python:   (2, 4, 1, 'final', 0)
numarray: 1.3.3
CPU:      x86_64
Success:  True

python:   (2, 3, 2, 'final', 0)
numarray: 0.9
CPU:      i686
Success:  1

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20051007/cf74af7f/attachment.sig>


More information about the Python-list mailing list