Quantcast
Channel: Active questions tagged set-difference - Stack Overflow
Browsing latest articles
Browse All 30 View Live

Comparing differences between two dataframes in R

I'm following the solution provided in Determining different rows between two data sets in R but the R code doesn't seem to work (getting no results) and I'm not sure why. Can someone help to explain...

View Article



Set difference versus set subtraction

What distinguishes - and .difference() on sets? Obviously the syntax is not the same. One is a binary operator, and the other is an instance method. What else?s1 = set([1,2,3])s2 =...

View Article

Determine Differences between Items in a List

I have several data frame that have a list of gene names without a header. Each files roughly looks like this:Table...

View Article

How to remove some filenames from the list of all filenames in that folder

I created in Stata a list of all files in a folder with the following:global file_all : dir "$outputsFolder" files "*.dta"However, I want to remove two files from this list. I wish to create another...

View Article

How to fill empty data with zeros?

After going through some previous answers I found that I could use this code to fill missing values of df1[0] which range from 340 to 515,with open('contactasortedtest.dat', 'r') as f: text =...

View Article


Multi-permutation data comparison in R

I have been comparing the common elements in multiple datasets and have been having great success with a small number of sets. However, I want to compare a larger number of datasets and I am trying to...

View Article

Two lists - removing elements (difference)

I have this classclass Accounts: def __init__(self, id, name, date): self.id = id self.name = name self.date = dateand two lists of this classesaccounts = []expired_accounts = []I want to delete...

View Article

How to find nonmatching colnames in 2 dataframes?

I have 2 data frames with colnames as dates.eg:2020-01-01, 2020-01-02 and so on.Some dates are missing from the second dataframe, hence different column length. I want to find out which dates are...

View Article


setdiff() showing no data in r

Trying to use a decision tree to predict drug classes, when I set a seed and then set the sample_frac() for my training data & then use setdiff() for my test data im seeing my data within the...

View Article


Select rows from one data.frame that are not present in a second data.frame

I have two data.frames:a1 <- data.frame(a = 1:5, b=letters[1:5])a2 <- data.frame(a = 1:3, b=letters[1:3])I want to find the rows a1 have that a2 doesn't.Is there a built in function for this type...

View Article

Python sets: difference() vs symmetric_difference()

What is the difference between difference() and symmetric_difference() methods in python sets?

View Article

MySQL: difference of two result sets

How can I get the set difference of two result sets?Say I have a result set (just one column in each):result1:'a''b''c'result2:'b''c'I want to minus what is in result1 by result2: result1 - result2...

View Article

Why is the Groovy method minus() so slow with lists of numbers?

Let's say I have two lists left and right of size n, each with unique integers, and I want to find the intersection and differences. This should be able to be done in O(n) or O(nlog(n)). This is how I...

View Article


Get distinct list between two lists in C#

I have two lists of strings. How do I get the list of distinct values between them or remove the second list elements from the first list? List<string> list1 = {...

View Article

What is the fastest or most elegant way to compute a set difference using...

Let A and B be two sets. I'm looking for really fast or elegant ways to compute the set difference (A - B or A \B, depending on your preference) between them. The two sets are stored and manipulated as...

View Article


difference of two sets of intervals

i'm trying to write some code to calculate the difference of two sets of intervals A - B , Interval endpoints are integers , but i'm strugling to come with efficient solution , any suggestion would be...

View Article

How can I find the length of row-wise set differences between two list...

I'm trying to take the row-wise set difference of two different list columns. So, line 1 column A would be a list of IDs for one year (m_lag), and line 2 column A would be a different list of IDs for...

View Article


setdiff() on grouped variables

I want to compare groups of variables to an external list (vector "Valid_codes").Consider the following exampleID<-c("Carl",...

View Article

Get difference between two lists with Unique Entries

I have two lists in Python:temp1 = ['One', 'Two', 'Three', 'Four']temp2 = ['One', 'Two']Assuming the elements in each list are unique, I want to create a third list with items from the first list which...

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

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


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


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

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

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


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

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

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

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



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
Browsing latest articles
Browse All 30 View Live




Latest Images