Re: [Tutor] decomposing a problem

2018-12-29 Thread Avi Gross
Of Steven D'Aprano Sent: Friday, December 28, 2018 11:12 PM To: tutor@python.org Subject: Re: [Tutor] decomposing a problem On Fri, Dec 28, 2018 at 10:39:53PM -0500, Avi Gross wrote: > I will answer this question then head off on vacation. You wrote about 140 or more lines, but didn't come cl

Re: [Tutor] decomposing a problem

2018-12-29 Thread Avi Gross
which rows are to be used for which purpose. Later, when using the data, you include a CONDITION that row X is true, or whatever. -Original Message- From: Tutor On Behalf Of Steven D'Aprano Sent: Friday, December 28, 2018 11:12 PM To: tutor@python.org Subject: Re: [Tutor] decomposing

Re: [Tutor] decomposing a problem

2018-12-28 Thread Steven D'Aprano
On Fri, Dec 28, 2018 at 10:39:53PM -0500, Avi Gross wrote: > I will answer this question then head off on vacation. You wrote about 140 or more lines, but didn't come close to answering the question: how to randomly split data from a dictionary into training data and reserved data. -- Steve

Re: [Tutor] decomposing a problem

2018-12-28 Thread Avi Gross
python consistently enough has everything being object-oriented. R started off without and has grafted on at least a dozen variations which can be a tad annoying. -----Original Message- From: Tutor On Behalf Of Steven D'Aprano Sent: Friday, December 28, 2018 8:04 PM To: tutor@python.org Subj

Re: [Tutor] decomposing a problem

2018-12-28 Thread Steven D'Aprano
On Fri, Dec 28, 2018 at 03:34:19PM -0500, Avi Gross wrote: [...] > You replied to one of my points with this about a way to partition data: > > --- > The obvious solution: > > keys = list(mydict.keys()) > random.shuffle(keys) > index = len(keys)*3//4 > training_data = keys[:index] > reserved =

Re: [Tutor] decomposing a problem

2018-12-28 Thread Alan Gauld via Tutor
On 28/12/2018 20:34, Avi Gross wrote: > So before I respond, here is a general statement. I am NOT particularly > interested in much of what we discuss here from a specific point of view. > Someone raises a question and I think about it. They want to know of a > better way to get a random key

Re: [Tutor] decomposing a problem

2018-12-28 Thread Avi Gross
Steve, I am going to just respond to one part of your message and will snip the rest. I am not is disagreement with most of what you say and may simply stress different aspects. I will say that unless I have reason to, I don't feel a need to test speeds for an academic discussion. Had this been a

Re: [Tutor] decomposing a problem

2018-12-28 Thread Mike Mossey
> On Dec 27, 2018, at 3:32 PM, Avi Gross wrote: > > [Mark Lawrence please press DELETE now in case the rest of this message is > all about you.] > [[If that is not working, if on Windows, try Control-ALT-DELETE as that will > really get rid of my message.]] > Hi Avi, Mark doesn’t have a

Re: [Tutor] decomposing a problem

2018-12-27 Thread Avi Gross
and fuming. Note, I do not intend to mention Mark again in future messages. I do not actually want to annoy him and wish he would live and let live. -Original Message- From: Tutor On Behalf Of Steven D'Aprano Sent: Thursday, December 27, 2018 5:38 PM To: tutor@python.org Subject:

Re: [Tutor] decomposing a problem

2018-12-27 Thread Steven D'Aprano
On Wed, Dec 26, 2018 at 11:02:07AM -0500, Avi Gross wrote: > I often find that I try to make a main point ad people then focus on > something else, like an example. I can't speak for others, but for me, that could be because of a number of reasons: - I agree with what you say, but don't feel

Re: [Tutor] decomposing a problem

2018-12-27 Thread Steven D'Aprano
On Thu, Dec 27, 2018 at 07:03:18PM +, Mark Lawrence wrote: > On 26/12/2018 00:00, Avi Gross wrote: > >[Long enough that some should neither read nor comment on.] > > > > PLEASE GO AWAY YOU ARE REALLY IRRITATING. People in glass houses... Mark, you're not the arbiter of who is allowed to

Re: [Tutor] decomposing a problem

2018-12-27 Thread Mark Lawrence
On 26/12/2018 00:00, Avi Gross wrote: [Long enough that some should neither read nor comment on.] PLEASE GO AWAY YOU ARE REALLY IRRITATING. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence

Re: [Tutor] decomposing a problem

2018-12-25 Thread Steven D'Aprano
On Tue, Dec 25, 2018 at 11:56:21PM -0500, Avi Gross wrote: > I find that many people are fairly uncomfortable with abstraction and > tend to resist a pure top down approach by diving to any solutions > they may envision. https://blog.codinghorror.com/it-came-from-planet-architecture/ > As

Re: [Tutor] decomposing a problem

2018-12-25 Thread Avi Gross
near each other. P.P.S. Please pardon my puns, especially the ones you did not notice. -Original Message- From: Tutor On Behalf Of Steven D'Aprano Sent: Tuesday, December 25, 2018 11:39 PM To: tutor@python.org Subject: Re: [Tutor] decomposing a problem On Tue, Dec 25, 2018 at 10:25:50PM

Re: [Tutor] decomposing a problem

2018-12-25 Thread Avi Gross
al Message- From: Mike Mossey Sent: Tuesday, December 25, 2018 9:49 PM To: Avi Gross Subject: Re: [Tutor] decomposing a problem > On Dec 25, 2018, at 4:00 PM, Avi Gross wrote: > > [Long enough that some should neither read nor comment on.] > > Mats raised an issue that

Re: [Tutor] decomposing a problem

2018-12-25 Thread Steven D'Aprano
On Tue, Dec 25, 2018 at 10:25:50PM -0500, Avi Gross wrote: > class chainable_list(list): > """Same as list but sort() can now be chained""" > def chainsort(this, *args, **kwargs): > this.sort(*args, **kwargs) > return this In Python, it is traditional to use "self" rather

Re: [Tutor] decomposing a problem

2018-12-25 Thread Avi Gross
method like pop() to suddenly return the list with a member dropped but it would be nice to fix some like this one: >>> testink.remove('7') >>> testink ['1', '3', '15'] Meanwhile, I hear Beethoven is decomp..., well never mind! It was probably Liszt! -Orig

Re: [Tutor] decomposing a problem

2018-12-25 Thread Cameron Simpson
On 26Dec2018 01:06, Alan Gauld wrote: On 26/12/2018 00:00, Avi Gross wrote: great. Many things in python can be made to fit and some need work. Dumb example is that sorting something internally returns None and not the object itself. This is one of my few complaints about Python. In

Re: [Tutor] decomposing a problem

2018-12-25 Thread Steven D'Aprano
On Wed, Dec 26, 2018 at 01:06:04AM +, Alan Gauld via Tutor wrote: > In Smalltalk the default return value from > any method is self. In Python it is None. > > self allows chaining of methods, None does not. You might be interested in this simple recipe for retrofitting method chaining

Re: [Tutor] decomposing a problem

2018-12-25 Thread Alan Gauld via Tutor
On 26/12/2018 00:00, Avi Gross wrote: > great. Many things in python can be made to fit and some need work. Dumb > example is that sorting something internally returns None and not the object > itself. This is one of my few complaints about Python. In Smalltalk the default return value from any