Quantcast
Channel: Active questions tagged set-difference - Stack Overflow
Browsing index pages (39 articles)
↧

I was able to unionize my 2 array sets, but I can't find the difference in sets

I am trying to compare the two sets and find the union/difference of them. The union is working, but the difference is not (output is an empty array).I used the "addAll()" function for unionizing, so I...

View Article


Python in-place merge sort help- alternative?

I'm trying to create an in-place merge sort algorithm for handling an array. I got some help on the for loop section, but am having trouble understanding it. Is there an alternative way to approach it...

View Article


How to do sane "set-difference" in Ruby?

Demo (I expect result [3]):[1,2] - [1,2,3] => [] # Hmm[1,2,3] - [1,2] => [3] # I seea = [1,2].to_set => #<Set: {1, 2}>b = [1,2,3].to_set => #<Set: {1, 2, 3}>a - b =>...

View Article

Find set_difference between set and map keys

I would like to ask if it is possible to provide an example on how I can find the difference between a set and keys of a map using set_differenceI know that another question std::set_difference is it...

View Article

Image may be NSFW.
Clik here to view.

How to use Shapely for subtracting two polygons

I am not really sure how to explain this but I have 2 polygons, Polygon1 and Polygon2. These polygons overlapped with each other. How to do I get Polygon2 using Shapely without the P from Polygon1.

View Article


Efficient algorithm for finding the non-overlapping set of two very large...

I am looking for the most efficient algorithm for comparing large set of strings that are representing possible amino acid substitutions at various positions of a 9mer peptide.As a toy example, the...

View Article

analog of setdiff() using regular expressions

Suppose I want to exclude values matching a series of regular expressions from a character vector, in the same way that I would use setdiff() for fixed character strings, e.g.value <- c("apple pie",...

View Article

Sorting columns and adding new variables using setdiff in R

I am a researcher and R novice working with a large dataset consisting of many small excel files to be read together. I have imported these into R using the read_excel functions and have them all in a...

View Article


How do I find the keys in one dictionary that do not have a counterpart in...

In Python, how do I find the keys in one dictionary that do not have a counterpart in another dictionary? The practical problem is that I have a dictionary of people that enrolled and a dictionary with...

View Article


Find integers in range which are not in a set

I need to find all IDs that are not in my table, between the min and max ID. Unfortunately MySQL has no simple way of generating sequences, so I thought it will be easier to do in the application.IDs...

View Article

bash, Linux: Set difference between two text files

I have two files A-nodes_to_delete and B-nodes_to_keep. Each file has a many lines with numeric ids.I want to have the list of numeric ids that are in nodes_to_delete but NOT in nodes_to_keep, i.e....

View Article

Function to find symmetric difference (opposite of intersection) in R?

The ProblemI have two string vectors of different lengths. Each vector has a different set of strings. I want to find the strings that are in one vector but not in both; that is, the symmetric...

View Article

How to compare nested lists in dataframe per row in R?

I have a dataset that contains lists for values in two columns, and I want to be able to compare the lists with each other, for each row. For example, I have 3 groups, in which certain numbers are...

View Article


Preserving the order in difference between two lists

I have two lists l and l_match. l_match is an empty list. l =...

View Article

Remove common list elements in lists of lists in R

I have a list of lists, I would like to remove the common elements between these sublists.For examplemylist = list(c(1, 2, 3, 4),c(2, 5, 6, 7),c(4, 2, 8, 9))becomesmylist = list(c(1, 3),c(5, 6, 7),c(8,...

View Article


Difference and intersection of two arrays containing objects

I have two arrays list1 and list2 which have objects with some properties; userId is the Id or unique property:list1 = [ { userId: 1234, userName: 'XYZ' }, { userId: 1235, userName: 'ABC' }, { userId:...

View Article

Loop through list of dataframes in R to take set difference

I'm hoping to take the set difference between 40 dataframes (10 years of data each with 4 quarters) starting with the second quarter of my first year and comparing it to the first quarter of my first...

View Article


Image may be NSFW.
Clik here to view.

Modifying Setdiff function in r [duplicate]

I am trying to find the difference between 2 tables based off one column but I am interested in knowing what is written in the whole row.Table 1Table 2Currently I have used Setdiff(Table1$name,...

View Article

How to filter out answer options on previous answers

I am creating a shiny app. I have a first multiple choice question q1 with a possible list of answers. In the second, one-choice question q2, as a list of possible answers I have the options selected...

View Article

Comparing string differences between two columns in the same row in R, then...

I'm working on automating toxicology read-in and import for unique case IDs from flat .csv files in R/RStudio. I've been asked to generate a spreadsheet that compares the differences between the manual...

View Article
Browsing index pages (39 articles)


Latest Images