[issue918] implement numpy.matrix in micronumpy
New submission from Peter <p.j.a.cock@googlemail.com>: Following should work on any version of bumpy, here using 1.5.1 on Python 2.6 on Mac OS X,
import numpy m = numpy.matrix([[1,0],[0,1]]) m matrix([[1, 0], [0, 1]])
Fails on pypy 1.6, $ pypy Python 2.7.1 (dcae7aed462b, Aug 17 2011, 09:46:15) [PyPy 1.6.0 with GCC 4.0.1] on darwin Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``it's not a hack, it's a workaround''
import numpy m = numpy.matrix([[1,0],[0,1]]) Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: 'module' object has no attribute 'matrix'
The matrix class is generally similar to a 2 dimensional array in numpy except that the * operator does matrix multiplication rather than element wise operation. This is particularly useful in teaching classes, even if many serious bumpy users prefer to avoid the matrix class and work with raw arrays and the dot method/function. ---------- messages: 3373 nosy: pypy-issue priority: bug release: 1.6 status: unread title: implement numpy.matrix in micronumpy ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue918> ________________________________________
Peter <p.j.a.cock@googlemail.com> added the comment: Note this will probably require fixing Issue 919 first, multidimensional arrays. ---------- nosy: +peterjc status: unread -> chatting ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue918> ________________________________________
Valery <khamenya@gmail.com> added the comment: Note, that the prerequisite Issue 919 is done a year ago. fijal, you may want to update "Release" field. ---------- assignedto: -> fijal nosy: +fijal, vak ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue918> ________________________________________
Brian Kearns <bdkearns@gmail.com> added the comment: works in latest pypy nightly and numpy fork ---------- nosy: +bdk status: chatting -> resolved ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue918> ________________________________________
participants (3)
-
Brian Kearns
-
Peter
-
Valery