[Numpy-discussion] Short-hand array creation in `numpy.mat` style

Jacco Hoekstra - LR J.M.Hoekstra at tudelft.nl
Tue Jul 15 02:33:30 EDT 2014


WeIl, I do not see the confusion here (only due to the use of the array function, maybe). It is a string, after all, so it should be colour-coded as such.

I would love to keep this feaure of np.mat in somehow, named np.txt2arr or something. We, linear algebraists, will already lose the .I method for matrix inversion, the * for matrix multiplication, let’s keep at least one of the many handy features of the matrix-type in.  It is simply a very useful, short-hand way, probably a separate function, to make a 2D-array. If you think it’s ugly, don’t use it. But it certainly is faster to type it and former Matlab-users will love it as well. Just my 2 cts.

From: numpy-discussion-bounces at scipy.org [mailto:numpy-discussion-bounces at scipy.org] On Behalf Of Alexander Belopolsky
Sent: zondag 13 juli 2014 19:31
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] Short-hand array creation in `numpy.mat` style

Also, the use of strings will confuse most syntax highlighters.  Compare the two options in this screenshot:

[Inline image 2]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140715/862ab2ab/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 7699 bytes
Desc: image002.jpg
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140715/862ab2ab/attachment.jpg>


More information about the NumPy-Discussion mailing list