Re: reduction

2016-06-01 Thread Fillmore
Thank you, guys. Your suggestions are avaluable. I think I'll go with the tree On 05/31/2016 10:22 AM, Fillmore wrote: My problem. I have lists of substrings associated to values: ['a','b','c','g'] => 1 ['a','b','c','h'] => 1 ['a','b','c','i'] => 1 ['a','b','c','j'] => 1 ['a','b','c','k'] =>

Re: reduction

2016-06-01 Thread Lawrence D’Oliveiro
On Thursday, June 2, 2016 at 10:07:21 AM UTC+12, MRAB wrote: > What is "this_list"? The main 'for' loop has "entry". Sorry. :) for entry in \ ( ['a','b','c','l'], ['a','b','c'], ) \ : flag = int(not any(m == "l" for m in entry)) ...

Re: reduction

2016-06-01 Thread MRAB
On 2016-06-01 22:44, Lawrence D’Oliveiro wrote: On Wednesday, June 1, 2016 at 2:22:42 AM UTC+12, Fillmore wrote: ['a','b','c','l'] => 0 # If "l" is in my data I have a zero ['a','b','c'] => 1 # or a more generic match will do the job for entry in \ (

Re: reduction

2016-06-01 Thread Lawrence D’Oliveiro
On Wednesday, June 1, 2016 at 2:22:42 AM UTC+12, Fillmore wrote: > ['a','b','c','l'] => 0 # If "l" is in my data I have a zero > ['a','b','c'] => 1 # or a more generic match will do the job for entry in \ ( ['a','b','c','l'], ['a','b','c'], ) \

Re: reduction

2016-05-31 Thread Steven D'Aprano
On Wed, 1 Jun 2016 12:22 am, Fillmore wrote: > > My problem. I have lists of substrings associated to values: > > ['a','b','c','g'] => 1 > ['a','b','c','h'] => 1 > ['a','b','c','i'] => 1 > ['a','b','c','j'] => 1 > ['a','b','c','k'] => 1 > ['a','b','c','l'] => 0 # <- Black sheep!!! >

RE: reduction

2016-05-31 Thread Dan Strohl via Python-list
> My problem. I have lists of substrings associated to values: > > ['a','b','c','g'] => 1 > ['a','b','c','h'] => 1 > ['a','b','c','i'] => 1 > ['a','b','c','j'] => 1 > ['a','b','c','k'] => 1 > ['a','b','c','l'] => 0 # <- Black sheep!!! > ['a','b','c','m'] => 1 > ['a','b','c','n'] => 1 >

Re: reduction

2016-05-31 Thread Ben Bacarisse
Ian Kelly writes: > On Tue, May 31, 2016 at 8:22 AM, Fillmore wrote: >> >> My problem. I have lists of substrings associated to values: >> >> ['a','b','c','g'] => 1 >> ['a','b','c','h'] => 1 >> ['a','b','c','i'] => 1 >> ['a','b','c','j'] => 1

Re: reduction

2016-05-31 Thread Ian Kelly
On Tue, May 31, 2016 at 8:22 AM, Fillmore wrote: > > My problem. I have lists of substrings associated to values: > > ['a','b','c','g'] => 1 > ['a','b','c','h'] => 1 > ['a','b','c','i'] => 1 > ['a','b','c','j'] => 1 > ['a','b','c','k'] => 1 > ['a','b','c','l'] => 0 #