Questions tagged [intersect]

The SQL intersect operator returns rows that are common between two tables without returning duplicate records.

643 questions
3
votes
3 answers

R Compare one set of values with multiple sets

I have a vector of values (x). I would like to determine the length of its overlap with each of the sets sitting in a list (y) - but without running a loop or lapply. Is it possible? I am really interested in accelerating the execution. Thank you…
user3245256
  • 1,842
  • 4
  • 24
  • 51
3
votes
2 answers

Intersect two lists and count how many times each element overlaps

I am intersecting two lists with the following code: def interlist(lst1,lst2): lst3 = list(filter(lambda x: x in lst1, lst2)) return lst3 The thing, is that I want to count every intersection between lst1 and lst2. The result should be a…
Cipher
  • 77
  • 1
  • 9
3
votes
2 answers

In scala, how can I get the count of elements that never shown in both arrays?

for example, i have array a Array[Int] = Array(1, 1, 2, 2, 3) array b Array[Int] = Array(2, 3, 4, 5) i'd like to count how many elements that only shown in a or b. in this case, it's (1, 1, 4, 5), so the count is 4. I tried diff, union, intersect,…
wwwwan
  • 407
  • 1
  • 4
  • 12
3
votes
3 answers

dissolve boundaries of polygon features in R

I've been looking for an existing R function(s) for aggregating polygon features within the same layer that share a common boundary (i.e., producing output like 'Dissolve Boundaries' tool in ArcGIS). I created a polygon layer from a raster file…
Dorothy
  • 523
  • 1
  • 5
  • 17
3
votes
2 answers

comparing two variables in the same column in R

I have two columns. one has a list of variables e.g. "cat", "dog", "rat", "chicken" and the other is whether the pet shop was visited on the first or second trip. visit_number pet 1 dog 2 dog 1 cat …
DFinch
  • 139
  • 1
  • 10
3
votes
1 answer

Intersection of circle with two line segments not detecting all intersection points

I am using SymPy's geometry module to intersect line segments and circles. It seems only some intersection points are being counted, while many others are ignored. Here is some test code for finding the intersection points: from sympy.geometry…
3
votes
4 answers

PHP/MySQL: Many-to-many/intersect table question

I'm not really sure how to phrase the question, so let me just give an example of the problem: Suppose there's a table which maps items to categories. Each item can have any number of categories, and each category can of course hold any number of…
user599599
  • 133
  • 2
  • 9
3
votes
1 answer

Using "UNION ALL" and "GROUP BY" to implement "Intersect"

I'v provided following query to find common records in 2 data sets but it's difficult for me to make sure about correctness of my query because of that I have a lot of data records in my DB. Is it OK to implement Intersect between "Customers" &…
Milad Rashidi
  • 1,296
  • 4
  • 22
  • 40
3
votes
1 answer

Laravel intersect wont get input

I have an intersect in my update method: $inputs = $request->intersect('message','name','email','is_read'); If i send an update request where is_read=0 the intersect returns an empty array. Works fine with anything else (false, 1 etc) Any…
user3844579
  • 485
  • 1
  • 8
  • 29
3
votes
2 answers

Linq to SQL and Intersect

Folks, I need to use Intersect on a LINQ to SQL query. However, I get an exception basically stating that I can't. The code compiles fine, but LINQ to SQL gets angry. Is there any way to replicate Intersect with LINQ to SQL? Thanks in advance.
CubanX
  • 5,176
  • 2
  • 29
  • 44
3
votes
1 answer

Move Camera to make all objects fit exactly inside the frustum - three.js

EDIT : I have rephrased my question to help users with the same problem. I have a three.js scene on which I have added some spheres. I want to move the camera towards a specific direction until all the objects (which are randomly positioned inside…
ThanosSar
  • 532
  • 6
  • 20
3
votes
1 answer

Linq to Nhibernate - Compare 2 lists

I have 2 lists and I need to know if there are any matches. I've tried using request.Interests.Intersect(x.Post.Tags.Split(' ')).Count() > 0 but I get the error System.NotImplementedException : The method Intersect is not implemented. So, I…
Josh
  • 16,286
  • 25
  • 113
  • 158
3
votes
1 answer

R grep find multiple complete words in vector

I have a vector of strings, say: vect<-c("oxidor magnesio","oxido magnesio","oxido calcio", "oxidante","oxido calcio magnesio","magnesio oxido") I'd like to find the occurences of both words, "oxido" and "magnesio". What I'm doing…
PavoDive
  • 6,322
  • 2
  • 29
  • 55
3
votes
1 answer

Range overlap/intersect by group and between years

I have a list of marked individuals (column Mark) which have been captured various years (column Year) within a range of the river (LocStart and LocEnd). Location on the river is in meters. I would like to know if a marked individual has used…
JoeBird
  • 65
  • 1
  • 10
3
votes
2 answers

c# Need help to understand this code

I am currently working on a project which is a Mastermind Game created in Windows Forms. After each time the player makes a guess where he put up what he thinks might be the correct colour order, he will get to know how many of his pins which were…
Easterlily
  • 199
  • 1
  • 2
  • 10