How about using the old name np.mat() for this type of array creation?

So the:

A = np.mat(“1 2;3 4”)

creates a two dimensional array.

But then resulting in an array A instead of the matrix type? It might at least 
provide some partial downward compatibility.

Best regards,
    Jacco Hoekstra


From: numpy-discussion-boun...@scipy.org 
[mailto:numpy-discussion-boun...@scipy.org] On Behalf Of Alexander Belopolsky
Sent: maandag 7 juli 2014 6:30
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] Short-hand array creation in `numpy.mat` style


On Sun, Jul 6, 2014 at 10:59 PM, Eric Firing 
<efir...@hawaii.edu<mailto:efir...@hawaii.edu>> wrote:
> I would suggest calling it something like np.array_simple or
> np.array_from_string, but the best choice IMO, would be
> np.ndarray.from_string (a static constructor method).

I think the problem is that this defeats the point: minimizing typing
when doing an off-the-cuff demo or test.

You can always put np.arr = np.ndarray.from_string or even arr = 
np.ndarray.from_string right next to the line where you define np.  (Which 
makes me wonder if something like this belongs to ipython magic.)
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to