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

2014-07-18 Thread josef . pktd
On Fri, Jul 18, 2014 at 5:04 PM, Joseph Martinot-Lagarde < joseph.martinot-laga...@m4x.org> wrote: > Le 18/07/2014 22:46, Chris Barker a écrit : > > On Fri, Jul 18, 2014 at 1:15 PM, Joseph Martinot-Lagarde > > > > wrote: > > > > In addition, > > you

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

2014-07-18 Thread Joseph Martinot-Lagarde
Le 18/07/2014 22:46, Chris Barker a écrit : > On Fri, Jul 18, 2014 at 1:15 PM, Joseph Martinot-Lagarde > > wrote: > > In addition, > you have to use AltGr on some keyboards to get the brackets. > > > If it's hard to type square brackets -- you're kin

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

2014-07-18 Thread Chris Barker
On Fri, Jul 18, 2014 at 1:15 PM, Joseph Martinot-Lagarde < joseph.martinot-laga...@m4x.org> wrote: > In addition, > you have to use AltGr on some keyboards to get the brackets. If it's hard to type square brackets -- you're kind of dead in the water with Python anyway -- this is not going to hel

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

2014-07-18 Thread josef . pktd
On Fri, Jul 18, 2014 at 4:21 PM, Charles G. Waldman wrote: > Joseph Martinot-Lagarde writes: > > > Compare what's comparable: > > That's fair. > > > In addition, you have to use AltGr on some keyboards to get the brackets > > Wow, it must be rather painful to do any real programming on such a > k

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

2014-07-18 Thread Charles G. Waldman
Joseph Martinot-Lagarde writes: > Compare what's comparable: That's fair. > In addition, you have to use AltGr on some keyboards to get the brackets Wow, it must be rather painful to do any real programming on such a keyboard! - C On Fri, Jul 18, 2014 at 1:15 PM, Joseph Martinot-Lagarde wr

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

2014-07-18 Thread Joseph Martinot-Lagarde
Le 18/07/2014 20:42, Charles G. Waldman a écrit : > Well, if the goal is "shorthand", typing numpy.array(numpy.mat()) > won't please many users. > > But the more I think about it, the less I think Numpy should support > this (non-Pythonic) input mode. Too much molly-coddling of new users! > When d

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

2014-07-18 Thread Chris Barker
On Fri, Jul 18, 2014 at 11:49 AM, Nathaniel Smith wrote: > Going through np.mat also fails on the meta-goal, which is to remove > reasons for people to prefer np.matrix to np.ndarray, so that eventually we > can deprecate the former without harm. > > As far as this goal goes, it's all very well f

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

2014-07-18 Thread Nathaniel Smith
On 18 Jul 2014 18:06, "Alan G Isaac" wrote: > > On 7/18/2014 12:45 PM, Mark Miller wrote: > > If the true goal is to just allow quick entry of a 2d array, why not just advocate using > > a = numpy.array(numpy.mat("1 2 3; 4 5 6; 7 8 9")) > > > It's even simpler: > a = np.mat(' 1 2 3;4 5 6;7 8 9').A

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

2014-07-18 Thread Charles G. Waldman
Well, if the goal is "shorthand", typing numpy.array(numpy.mat()) won't please many users. But the more I think about it, the less I think Numpy should support this (non-Pythonic) input mode. Too much molly-coddling of new users! When doing interactive work I usually just type: >>> np.array([[1,

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

2014-07-18 Thread Alan G Isaac
On 7/18/2014 12:45 PM, Mark Miller wrote: > If the true goal is to just allow quick entry of a 2d array, why not just > advocate using > a = numpy.array(numpy.mat("1 2 3; 4 5 6; 7 8 9")) It's even simpler: a = np.mat(' 1 2 3;4 5 6;7 8 9').A I'm not putting a dog in this race. Still I would say

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

2014-07-18 Thread Nathaniel Smith
On Fri, Jul 18, 2014 at 3:02 PM, Charles G. Waldman wrote: > I greatly prefer "np.mat" to "np.arr" for this, FWIW Unfortunately that's already taken... -- Nathaniel J. Smith Postdoctoral researcher - Informatics - University of Edinburgh http://vorpus.org ___

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

2014-07-18 Thread Mark Miller
On Fri, Jul 18, 2014 at 3:37 AM, Nathaniel Smith wrote: > On Thu, Jul 17, 2014 at 11:10 PM, Charles G. Waldman > wrote: > > > > -1 on the 'arr' name. I think if we're going to support this function > at all (which I'm not convinced is a good idea), it should be > np.fromsomething like the other

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

2014-07-18 Thread Charles G. Waldman
I greatly prefer "np.mat" to "np.arr" for this, FWIW On Fri, Jul 18, 2014 at 3:37 AM, Nathaniel Smith wrote: > On Thu, Jul 17, 2014 at 11:10 PM, Charles G. Waldman > wrote: >> >> -1 on the 'arr' name. I think if we're going to support this function at >> all (which I'm not convinced is a goo

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

2014-07-18 Thread Nathaniel Smith
On Thu, Jul 17, 2014 at 11:10 PM, Charles G. Waldman wrote: > > -1 on the 'arr' name. I think if we're going to support this function at all > (which I'm not convinced is a good idea), it should be np.fromsomething like > the other from* functions. > > Maybe frommatlab? > > I think that 'arr' i

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

2014-07-18 Thread Charles G. Waldman
-1 on the 'arr' name. I think if we're going to support this function at all (which I'm not convinced is a good idea), it should be np.fromsomething like the other from* functions. Maybe frommatlab? I think that 'arr' is just too generic and too close to 'array'. On Tue, Jul 15, 2014 at 3:5

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

2014-07-15 Thread Nathaniel Smith
On Sun, Jul 13, 2014 at 6:31 PM, Alexander Belopolsky wrote: > Also, the use of strings will confuse most syntax highlighters. Compare > the two options in this screenshot: > > [image: Inline image 2] > I guess this is a minor issue for "real" code, but even IPython doesn't (yet?) provide synta

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

2014-07-15 Thread Alexander Belopolsky
Also, the use of strings will confuse most syntax highlighters. Compare the two options in this screenshot: [image: Inline image 2] ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

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

2014-07-15 Thread Jacco Hoekstra - LR
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] ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman

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

2014-07-14 Thread Alexander Belopolsky
On Fri, Jul 11, 2014 at 4:30 PM, Daniel da Silva wrote: > If leading a presentation on scientific computing in Python to beginners, > which would look better on a bullet in a slide? > >- > >np.build('.2 .7 .1; .3 .5 .2; .1 .1 .9')) > >- > >np.array([[.2, .7, .1], [.3, .5, .2], [.1

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

2014-07-13 Thread Daπid
On 11 July 2014 22:30, Daniel da Silva wrote: > I think the idea at hand is not that it would be used everyday, but it > would be there when needed. What people do everyday is with *real* data. > They are using functions to load the data. > But sometimes we have to hard-code a few values, and it

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

2014-07-12 Thread Daniel da Silva
I think the idea at hand is not that it would be used everyday, but it would be there when needed. What people do everyday is with *real* data. They are using functions to load the data. Where this would come in useful would be presentations and tutorials. If leading a presentation on scientific c

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

2014-07-08 Thread Pauli Virtanen
07.07.2014 21:32, Chris Barker - NOAA Federal kirjoitti: > If you are going to introduce this functionality, please don't call it > np.arr. It might be appropriate for pirate versions of Numpy. *** Seriously though, having a variant of `mat` that returns arrays could be useful, so weak +0. P

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

2014-07-07 Thread Chris Barker - NOAA Federal
On Jul 7, 2014, at 7:28 AM, Sebastian Berg wrote: > not sure that many use np.r_ or np.c_ I actually really like those ;-) -Chris ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

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

2014-07-07 Thread Chris Barker - NOAA Federal
If you are going to introduce this functionality, please don't call it np.arr. I agree, but.., 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). Except the entire point of h

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

2014-07-07 Thread josef . pktd
On Mon, Jul 7, 2014 at 1:58 PM, Nathaniel Smith wrote: > On Mon, Jul 7, 2014 at 3:28 PM, Sebastian Berg > wrote: > > On Mo, 2014-07-07 at 09:50 -0400, josef.p...@gmail.com wrote: > >> > >> On Mon, Jul 7, 2014 at 9:11 AM, Sebastian Berg > >> wrote: > >> On Mo, 2014-07-07 at 08:25 -0400,

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

2014-07-07 Thread Nathaniel Smith
On Mon, Jul 7, 2014 at 3:28 PM, Sebastian Berg wrote: > On Mo, 2014-07-07 at 09:50 -0400, josef.p...@gmail.com wrote: >> >> On Mon, Jul 7, 2014 at 9:11 AM, Sebastian Berg >> wrote: >> On Mo, 2014-07-07 at 08:25 -0400, Alan G Isaac wrote: >> > On 7/7/2014 7:17 AM, Daπid wrote: >>

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

2014-07-07 Thread Sebastian Berg
On Mo, 2014-07-07 at 09:50 -0400, josef.p...@gmail.com wrote: > > > > On Mon, Jul 7, 2014 at 9:11 AM, Sebastian Berg > wrote: > On Mo, 2014-07-07 at 08:25 -0400, Alan G Isaac wrote: > > On 7/7/2014 7:17 AM, Daπid wrote: > > > How about a new one? np.matarray, for MATLAB

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

2014-07-07 Thread josef . pktd
On Mon, Jul 7, 2014 at 9:11 AM, Sebastian Berg wrote: > On Mo, 2014-07-07 at 08:25 -0400, Alan G Isaac wrote: > > On 7/7/2014 7:17 AM, Daπid wrote: > > > How about a new one? np.matarray, for MATLAB array. > > > > > > How about `str2arr` or even `build`, since teaching appears to be a > focus. >

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

2014-07-07 Thread Sebastian Berg
On Mo, 2014-07-07 at 08:25 -0400, Alan G Isaac wrote: > On 7/7/2014 7:17 AM, Daπid wrote: > > How about a new one? np.matarray, for MATLAB array. > > > How about `str2arr` or even `build`, since teaching appears to be a focus. > Also, I agree '1 2 3' shd become 1d and '1 2 3;' shd become 2d. > It

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

2014-07-07 Thread Alan G Isaac
On 7/7/2014 7:17 AM, Daπid wrote: > How about a new one? np.matarray, for MATLAB array. How about `str2arr` or even `build`, since teaching appears to be a focus. Also, I agree '1 2 3' shd become 1d and '1 2 3;' shd become 2d. It seems unambiguous to allow '1 2 3;;' to be 3d, or even '1 2;3 4;;5

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

2014-07-07 Thread Daπid
On 7 July 2014 08:48, Jacco Hoekstra - LR wrote: > How about using the old name np.mat() for this type of array creation? How about a new one? np.matarray, for MATLAB array. /David. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://

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

2014-07-06 Thread Jacco Hoekstra - LR
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

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

2014-07-06 Thread Alexander Belopolsky
On Sun, Jul 6, 2014 at 10:59 PM, Eric Firing 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: mini

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

2014-07-06 Thread Eric Firing
On 2014/07/06, 4:27 PM, Alexander Belopolsky wrote: > > On Sun, Jul 6, 2014 at 6:06 PM, Eric Firing > wrote: > > (I'm not entirely convinced > np.arr() is a good idea at all; but if it is, it must be kept simple.) > > > If you are going to introduce this functi

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

2014-07-06 Thread Alexander Belopolsky
On Sun, Jul 6, 2014 at 6:06 PM, Eric Firing wrote: > (I'm not entirely convinced > np.arr() is a good idea at all; but if it is, it must be kept simple.) > If you are going to introduce this functionality, please don't call it np.arr. Right now, np.a presents you with a whopping 53 completion

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

2014-07-06 Thread Eric Firing
On 2014/07/06, 11:43 AM, Nathaniel Smith wrote: > On Sun, Jul 6, 2014 at 9:35 PM, Daniel da Silva > wrote: >> The idea is that there be a short-hand for creating arrays as there is for >> matrices: >> >>np.mat('.2 .7 .1; .3 .5 .2; .1 .1 .9') >> >> It was suggested in GitHub issue #4817 in ligh

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

2014-07-06 Thread Nathaniel Smith
On Sun, Jul 6, 2014 at 9:35 PM, Daniel da Silva wrote: > The idea is that there be a short-hand for creating arrays as there is for > matrices: > > np.mat('.2 .7 .1; .3 .5 .2; .1 .1 .9') > > It was suggested in GitHub issue #4817 in light that it would be beneficial > to beginners and to present

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

2014-07-06 Thread Daniel da Silva
The idea is that there be a short-hand for creating arrays as there is for matrices: np.mat('.2 .7 .1; .3 .5 .2; .1 .1 .9') It was suggested in GitHub issue #4817 in light that it would be beneficial to beginners and to presenters during demonstratio