linalg.det throws IndexError on 2.6.5
I'm not sure what's causing this at this point and before I dig deeper thought someone can shed some light... On my Mac OS X python 2.6.1, numpy.linalg.det functions properly...
numpy.linalg.det(numpy.array([[1, 2], [3, 4]])) 2.0
numpy.linalg.det(numpy.array([[1, 2], [3, 4]])) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/python2.6/lib/python2.6/sitepackages/numpy/linalg/linalg.py",
On Centos 5 python 2.6.5, I get and IndexError (out of bounds)... line 1507, in det return (1.2.*sign)*multiply.reduce(diagonal(a), axis=1) File "/opt/python2.6/lib/python2.6/sitepackages/numpy/core/fromnumeric.py", line 949, in diagonal return asarray(a).diagonal(offset, axis1, axis2) IndexError: index 12884901888 out of bounds 0<=index<4 Any ideas? Thanks. Ilya
On Sun, May 30, 2010 at 1:32 PM, Ilya Sterin <sterini@gmail.com> wrote:
I'm not sure what's causing this at this point and before I dig deeper thought someone can shed some light...
On my Mac OS X python 2.6.1, numpy.linalg.det functions properly...
numpy.linalg.det(numpy.array([[1, 2], [3, 4]])) 2.0
On Centos 5 python 2.6.5, I get and IndexError (out of bounds)...
numpy.linalg.det(numpy.array([[1, 2], [3, 4]])) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/python2.6/lib/python2.6/sitepackages/numpy/linalg/linalg.py", line 1507, in det return (1.2.*sign)*multiply.reduce(diagonal(a), axis=1) File "/opt/python2.6/lib/python2.6/sitepackages/numpy/core/fromnumeric.py", line 949, in diagonal return asarray(a).diagonal(offset, axis1, axis2) IndexError: index 12884901888 out of bounds 0<=index<4
Any ideas?
What numpy version? Also, who built the numpy/python? I rather suspect a type problem somewhere. Chuck
Numpy 1.4.1. I built it myself. The version of numpy in question on CentOS was built against a 2.6.5 version of python 64 bit binary and built/installed with pip. The version which is working on my OS X is a universal binary and both python and numpy are built as such. I'm running python in 64bit mode though and all works fine there. I just tried to install numpy as per yum instructions on numpy site with the default Centos python 2.4. It installed numpy 1.2 and the determinant function works there. I need to get this to work with 2.6 though, as my app relies on it. Any ideas? Thanks. Ilya On Sun, May 30, 2010 at 4:02 PM, Charles R Harris <charlesr.harris@gmail.com> wrote:
On Sun, May 30, 2010 at 1:32 PM, Ilya Sterin <sterini@gmail.com> wrote:
I'm not sure what's causing this at this point and before I dig deeper thought someone can shed some light...
On my Mac OS X python 2.6.1, numpy.linalg.det functions properly...
numpy.linalg.det(numpy.array([[1, 2], [3, 4]])) 2.0
On Centos 5 python 2.6.5, I get and IndexError (out of bounds)...
numpy.linalg.det(numpy.array([[1, 2], [3, 4]])) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/python2.6/lib/python2.6/sitepackages/numpy/linalg/linalg.py", line 1507, in det return (1.2.*sign)*multiply.reduce(diagonal(a), axis=1) File "/opt/python2.6/lib/python2.6/sitepackages/numpy/core/fromnumeric.py", line 949, in diagonal return asarray(a).diagonal(offset, axis1, axis2) IndexError: index 12884901888 out of bounds 0<=index<4
Any ideas?
What numpy version? Also, who built the numpy/python? I rather suspect a type problem somewhere.
Chuck
_______________________________________________ NumPyDiscussion mailing list NumPyDiscussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpydiscussion
On Sun, May 30, 2010 at 2:22 PM, Ilya Sterin <sterini@gmail.com> wrote:
Numpy 1.4.1. I built it myself.
The version of numpy in question on CentOS was built against a 2.6.5 version of python 64 bit binary and built/installed with pip.
The version which is working on my OS X is a universal binary and both python and numpy are built as such. I'm running python in 64bit mode though and all works fine there.
I just tried to install numpy as per yum instructions on numpy site with the default Centos python 2.4. It installed numpy 1.2 and the determinant function works there.
I need to get this to work with 2.6 though, as my app relies on it. Any ideas?
Thanks.
It works fine for me on 2.6, which is why I asked for more details. $[charris@ubuntu ~]$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import numpy numpy.linalg.det(numpy.array([[1, 2], [3, 4]])) 2.0 numpy.__version__ '1.4.1'
Did you remove the previous installation of numpy, if any? And why not do the usual "sudo python setup.py install" thingie instead of pip? Chuck
Yeah, there were no previous installs. Well, I removed the pip installed numpy and did a python setup.py install and all works now. Really bizarre, I didn't think pip did much outside of the standard python setup.py install, other that some more automation. Thanks for the help. Ilya On Sun, May 30, 2010 at 5:15 PM, Charles R Harris <charlesr.harris@gmail.com> wrote:
On Sun, May 30, 2010 at 2:22 PM, Ilya Sterin <sterini@gmail.com> wrote:
Numpy 1.4.1. I built it myself.
The version of numpy in question on CentOS was built against a 2.6.5 version of python 64 bit binary and built/installed with pip.
The version which is working on my OS X is a universal binary and both python and numpy are built as such. I'm running python in 64bit mode though and all works fine there.
I just tried to install numpy as per yum instructions on numpy site with the default Centos python 2.4. It installed numpy 1.2 and the determinant function works there.
I need to get this to work with 2.6 though, as my app relies on it. Any ideas?
Thanks.
It works fine for me on 2.6, which is why I asked for more details.
$[charris@ubuntu ~]$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import numpy numpy.linalg.det(numpy.array([[1, 2], [3, 4]])) 2.0 numpy.__version__ '1.4.1'
Did you remove the previous installation of numpy, if any? And why not do the usual "sudo python setup.py install" thingie instead of pip?
Chuck
_______________________________________________ NumPyDiscussion mailing list NumPyDiscussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpydiscussion
participants (2)

Charles R Harris

Ilya Sterin