[web2py] Re: Intersection of rows

2018-02-15 Thread Dave S
On Thursday, February 15, 2018 at 10:44:46 AM UTC-8, Anthony wrote: > > Both methods work with my main test data (the source of 111 X and 10 Y), >> yielding 9 runs that match both. The alias method, however, let a >> duplicate row sneak in. I need to test more pairs, but I think you >> (Anth

[web2py] Re: Intersection of rows

2018-02-15 Thread Anthony
> > Both methods work with my main test data (the source of 111 X and 10 Y), > yielding 9 runs that match both. The alias method, however, let a > duplicate row sneak in. I need to test more pairs, but I think you > (Anthony) solved my problem. > If the alias method is producing duplicates,

[web2py] Re: Intersection of rows

2018-02-15 Thread Dave S
On Wednesday, February 14, 2018 at 1:02:52 PM UTC-8, Dave S wrote: > > > > On Tuesday, February 13, 2018 at 7:37:22 AM UTC-8, Anthony wrote: >> >> On Tuesday, February 13, 2018 at 4:09:02 AM UTC-5, Dave S wrote: >>> >>> That's yielding 0 rows from the run table (for my chosen args).. It >>> loo

[web2py] Re: Intersection of rows

2018-02-14 Thread Dave S
On Tuesday, February 13, 2018 at 7:37:22 AM UTC-8, Anthony wrote: > > On Tuesday, February 13, 2018 at 4:09:02 AM UTC-5, Dave S wrote: >> >> That's yielding 0 rows from the run table (for my chosen args).. It >> looks to me like it is requiring the segment row to match both arguments. >> If I

[web2py] Re: Intersection of rows

2018-02-13 Thread Anthony
On Tuesday, February 13, 2018 at 4:09:02 AM UTC-5, Dave S wrote: > > That's yielding 0 rows from the run table (for my chosen args).. It looks > to me like it is requiring the segment row to match both arguments. If I > use > a/c/f/Cabot/Cabot in the url, I get the 10 rows for runs that have Ca

[web2py] Re: Intersection of rows

2018-02-13 Thread Dave S
1. On Saturday, February 10, 2018 at 6:05:31 AM UTC-8, Anthony wrote: > > segq1 = db.segment.waypoint.contains(request.args[0]) >> segq2 = db.segment.waypoint.contains(request.args[1]) >> runs1 = db((db.run.id == db.segment.partof) & segq1).select("run.id", >> "run.descri

[web2py] Re: Intersection of rows

2018-02-10 Thread Anthony
> > segq1 = db.segment.waypoint.contains(request.args[0]) > segq2 = db.segment.waypoint.contains(request.args[1]) > runs1 = db((db.run.id == db.segment.partof) & segq1).select("run.id", > "run.description", "run.distance","run.duration", orderby = db.run.id|db. > run.duration, distinc

[web2py] Re: Intersection of rows

2018-02-10 Thread Dave S
On Friday, February 9, 2018 at 5:26:35 PM UTC-8, Anthony wrote: > > Anyway, given your code, it looks like we would not expect any results in >>> the intersection of the two Rows objects, as the conditions of each query >>> are mutually exclusive (i.e., "waypoint" either equals X or Y). Of course

[web2py] Re: Intersection of rows

2018-02-09 Thread Anthony
> > Anyway, given your code, it looks like we would not expect any results in >> the intersection of the two Rows objects, as the conditions of each query >> are mutually exclusive (i.e., "waypoint" either equals X or Y). Of course, >> if X == Y, then the two sets of Rows are identical, but I a

[web2py] Re: Intersection of rows

2018-02-09 Thread Dave S
On Thursday, February 8, 2018 at 6:23:59 PM UTC-8, Anthony wrote: > > Looks like the book is wrong -- according to the code, rows1 & rows2 > simply combines the records from each Rows object -- it does not find the > intersection. > Okay, then my results match that! > Anyway, given your cod

[web2py] Re: Intersection of rows

2018-02-08 Thread Anthony
On Thursday, February 8, 2018 at 9:27:44 PM UTC-5, Anthony wrote: > > On Thursday, February 8, 2018 at 9:23:59 PM UTC-5, Anthony wrote: >> >> Looks like the book is wrong -- according to the code, rows1 & rows2 >> simply combines the records from each Rows object -- it does not find the >> inters

[web2py] Re: Intersection of rows

2018-02-08 Thread Anthony
On Thursday, February 8, 2018 at 9:23:59 PM UTC-5, Anthony wrote: > > Looks like the book is wrong -- according to the code, rows1 & rows2 > simply combines the records from each Rows object -- it does not find the > intersection. > Actually, the book was originally correct, and at some point it

[web2py] Re: Intersection of rows

2018-02-08 Thread Anthony
Looks like the book is wrong -- according to the code, rows1 & rows2 simply combines the records from each Rows object -- it does not find the intersection. Anyway, given your code, it looks like we would not expect any results in the intersection of the two Rows objects, as the conditions of e

[web2py] Re: Intersection of rows

2018-02-06 Thread Dave S
On Tuesday, February 6, 2018 at 1:57:29 PM UTC-8, Dave S wrote: > > [...] > I think this is on 2.14.6; I may be able to test newer web2py's tonight. > Am I doing something wrong, or was there a hiccup in intersection? > > Downloading 2.16.1 and blindly copying my 2.14.6 copy to the new enviro