Re: Any ReST aware editors?

2016-09-22 Thread Manolo Martínez
On 09/23/16 at 01:20am, Chris Angelico wrote: > If I were doing this, I'd simply have a script that watches the .rst > file and rebuilds a corresponding output file, which can then be shown > in another window, completely separate to the editor. [when-changed]://github.com/joh/when-changed) is a

Re: Suggestion: make sequence and map interfaces more similar

2016-03-30 Thread Manolo Martínez
On 03/30/16 at 09:17pm, Steven D'Aprano wrote: > On Wed, 30 Mar 2016 06:12 pm, Jussi Piitulainen wrote: > > > Steven D'Aprano writes: > > > >> Given a surjection (many-to-one mapping) > > > > No. And I doubt that Wikipedia says that. > > > No to what? What are you disagreeing with? > I think

Re: Suggestion: make sequence and map interfaces more similar

2016-03-30 Thread Manolo Martínez
On 03/30/16 at 01:40pm, Jussi Piitulainen wrote: > Manolo Martínez writes: > > > I think it's with your definition of surjection. Bijections are > > surjective, no? > > Yes, and most many-to-one mappings are *not* surjective. Well, I don't know about most, the

Re: Suggestion: make sequence and map interfaces more similar

2016-03-30 Thread Manolo Martínez
On 03/30/16 at 02:44pm, Marko Rauhamaa wrote: > Jussi Piitulainen : > > > Manolo Martínez writes: > >> On 03/30/16 at 01:40pm, Jussi Piitulainen wrote: > >>> Yes, and most many-to-one mappings are *not* surjective. > >> > >> Well, I don'

Re: Suggestion: make sequence and map interfaces more similar

2016-03-30 Thread Manolo Martínez
On 03/30/16 at 03:55pm, Marko Rauhamaa wrote: > Manolo Martínez : > > > On 03/30/16 at 02:44pm, Marko Rauhamaa wrote: > >> I don't even know if you can say much about the cardinality (or > >> countability) of mappings. The general set of mappings can't

Re: ola

2016-04-07 Thread Manolo Martínez
On 04/06/16 at 08:59pm, Joel Goldstick wrote: > 2016-04-05 20:35 GMT-04:00 majoxd hola : > > me podrían enviar el programa Python spyder para Windows? > > > This is an english language list. And besides, your question I could > send the Python program spyder for Windows? is awfully vague They a

Re: You gotta love a 2-line python solution

2016-05-02 Thread Manolo Martínez
On 05/02/16 at 11:24am, Larry Martell wrote: > That reminds me of something I heard many years ago. > > Every non-trivial program can be simplified by at least one line of code. > Every non trivial program has at least one bug. > > Therefore every non-trivial program can be reduced to one line of

A request for examples of successful abstracts to scientific python conferences

2019-04-03 Thread Manolo Martínez
(off-list) successful abstracts submitted to other editions of this or similar conferences? Also, perhaps, general resources that I should read before responding to a computer science CFP? That would be extremely helpful. Thanks in advance. Best, Manolo Martínez Universitat de Barcel

Re: Friday Filosofical Finking: Import protections

2019-04-18 Thread Manolo Martínez
On 2019-04-17, DL Neil wrote: > 2. When the program can still do something useful (if perhaps > feature-limited) without the imported module by substituting > something else in its place. Isn't this a very common scenario, similar to what package management systems call "optional de

Re: Is vars() the most useless Python built-in ever?

2015-12-01 Thread Manolo Martínez
On 12/01/15 at 12:00pm, Steven D'Aprano wrote: > I'm trying to understand why vars() exists. Does anyone use it? Well, I have this little podcast aggregator (https://github.com/manolomartinez/greg) that I and a bunch of other people use. I started writing it some years ago, and the code is a bit o

Re: Is vars() the most useless Python built-in ever?

2015-12-01 Thread Manolo Martínez
Peter, thanks for taking the time to look into my code. On 12/01/15 at 11:40am, Peter Otten wrote: > Manolo Martínez wrote: > > def main(): # parse the args and call whatever function was > selected > > try: > > args = pars

Re: 4D arrays

2015-12-02 Thread Manolo Martínez
On 12/01/15 at 06:47pm, Peter Otten wrote: > Extract 2D arrays: > > >>> a[:,2,3] > array([[ 55, 56, 57, 58, 59], >[115, 116, 117, 118, 119]]) > >>> a[1,:,2] > array([[ 70, 71, 72, 73, 74], >[ 90, 91, 92, 93, 94], >[110, 111, 112, 113, 114]]) The first one is eq

Re: Is vars() the most useless Python built-in ever?

2015-12-02 Thread Manolo Martínez
Dear Peter, and Steven, thanks again for engaging with my script. I'm fully aware that this is not the tutor mailing list :) Peter Otten wrote: > As far as I can see in a correctly written script the AttributeError cannot > be triggered by the user as argparse handles this case automatically by

Re: Is vars() the most useless Python built-in ever?

2015-12-02 Thread Manolo Martínez
On 12/02/15 at 08:33pm, Chris Angelico wrote: > On Wed, Dec 2, 2015 at 8:09 PM, Manolo Martínez > > This... is true. I could have sworn that's not the way argparse behaved > > when I wrote that snippet, but I've been very wrong before about similar > > things. Anywa

Re: numpy arrays

2016-03-23 Thread Manolo Martínez
On 03/23/16 at 03:06am, Heli wrote: > I have a 2D numpy array like this: > > [[1,2,3,4], > [1,2,3,4], > [1,2,3,4] > [1,2,3,4]] > > Is there any fast way to convert this array to > > [[1,1,1,1], > [2,2,2,2] > [3,3,3,3] > [4,4,4,4]] You don't mean just transposing your original array, as

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-11 Thread Manolo Martínez
On 11/10/14 at 09:00pm, Grant Edwards wrote: > That's the saddest troll I've seen in ages. That, on the other hand, is a pretty decent bit of trolling. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Worst Practices

2015-03-02 Thread Manolo Martínez
On 03/02/15 at 08:59am, alister wrote: > or as another analogy why don't you (Marco) try telling a Barber in > Seville that he should be speaking Latin Spanish not that strange > variation he uses? > > I suspect the reaction you get will be far more severe than the one you > are getting from

Re: numpy array product driving me mad

2015-03-20 Thread Manolo Martínez
On 03/20/15 at 01:46pm, Mr. Twister wrote: > I have two numpy arrays: > > >>> P > array([[[ 2, 3], > [33, 44], > [22, 11], > [ 1, 2]]]) > >>> R > array([0, 1, 2, 3]) > > the values of these may of course be different. The important fact is that: > > >>> P.shape > (1,

Re: numpy array product driving me mad

2015-03-20 Thread Manolo Martínez
On 03/20/15 at 02:11pm, Manolo Martínez wrote: > On 03/20/15 at 01:46pm, Mr. Twister wrote: > > > I have two numpy arrays: [...] > > Is there a direct, single expression command to get this result? > > I think that you want > > P * R[;,None] Sorr

Re: Python as shell

2015-04-23 Thread Manolo Martínez
On 04/22/15 at 07:25pm, Cecil Westerhof wrote: > I thought there was a Python shell that could be used instead of Bash > (or whichever shell you are using) Perhaps you had [xonsh](http://xonsh.org/) in mind? Manolo -- https://mail.python.org/mailman/listinfo/python-list

Re: Prime testing [was Re: My backwards logic]

2014-09-06 Thread Manolo Martínez
On 09/06/14 at 08:38pm, Steven D'Aprano wrote: > But even that's not how the specialists do it. If you want to check whether > (say) 2**3000+1 is prime, you don't want to use trial division at all... When I was interested in these things, specialists would use the [number field sieve](https://en.w

Re: Prime testing [was Re: My backwards logic]

2014-09-07 Thread Manolo Martínez
On 09/07/14 at 06:53pm, Peter Pearson wrote: > On Sat, 6 Sep 2014 12:53:16 +0200, Manolo Martínez wrote: > > On 09/06/14 at 08:38pm, Steven D'Aprano wrote: > >> But even that's not how the specialists do it. If you want to check whether > >> (say) 2**3000+1