[Numpy-discussion] deprecate numpy.matrix

Matthew Brett matthew.brett at gmail.com
Sun Feb 9 18:07:35 EST 2014


Hi,

On Sun, Feb 9, 2014 at 2:55 PM, alex <argriffi at ncsu.edu> wrote:
> On Sun, Feb 9, 2014 at 5:12 PM, Alan G Isaac wrote:
>> On 2/9/2014 4:59 PM, alex wrote:
>>> """
>>> The ``numpy.matrix`` API provides a low barrier to using Python
>>> for linear algebra, just as the pre-3 Python ``input`` function
>>> and ``print`` statement provided low barriers to using Python for
>>> automatically evaluating input and for printing output.
>>>
>>> On the other hand, it really needs to be deprecated.
>>> Let's deprecate ``numpy.matrix``.
>>> """
>>>
>>> I understand that numpy.matrix will not be deprecated any time soon,
>>> but I hope this will register as a vote to help nudge its deprecation
>>> closer to the realm of acceptable discussion.
>>
>> I believe you will want to see the archived discussions of this
>> controversial issue before broaching it again, and then
>> when you do so, broach it in terms of the points that
>> have been raised **in great detail** in the past.
>
> I haven't followed the numpy mailing list, but some googling found a
> six years old thread
> http://mail.scipy.org/pipermail/scipy-user/2008-May/016738.html
> where Nathan Bell raised the question of numpy.matrix deprecation and
> you replied that you find them helpful for teaching and that you
> personally find them convenient to use.  Perhaps coincidentally (or
> not...) I'm working on the same kinds of problems in scipy development
> (functions involving sparse matrices and abstract linear operators) as
> Nathan Bell had been working on when he made this post.
>
> I understand that unless I am aware of the history of this discussion
> there is no point in my broaching this controversial issue directly,
> but perhaps I could broach it indirectly by asking if anyone with a
> deeper understanding of the background of this issue has compiled some
> document enumerating or summarizing the points that have been made?

As I was saying over in the starting github issue thread, I have found
that I use Sympy for demonstrating linear algebra on matrices.  Here's
an example:

http://nbviewer.ipython.org/urls/raw2.github.com/practical-neuroimaging/pna-notebooks/master/Introducing%20the%20General%20Linear%20Model.ipynb

Best,

Matthew



More information about the NumPy-Discussion mailing list