Questions tagged [pairwise]
273 questions
1
vote
1 answer
apply pairwise function on a pandas dataframe python
I have a dataframe, and I would like to apply my own distance pairwise.
The problem it that myDistance takes 2 dataframes, and using skelarn pairwise_distance or scipy pdist converts is to ndarray.
Example:
df =…

matlabit
- 838
- 2
- 13
- 31
1
vote
2 answers
R-Common elements on all pairwise comparisons of elements of a vector
I have a vector in R, say c(2, 2, 3, 2, 3, 4, 4), and I want to build a square matrix of size n (the number of elements of the vector) that has a 1 if the element i of the vector has the same value of the element j , and 0 otherwise. In this example…

coolsv
- 781
- 5
- 16
1
vote
2 answers
pairwise ANOVA of subset of data
I need to perform multiple pairwise ANOVA's in R, and correct the p-values using bonferroni. However I don't need to compare every CLASS to each other. Below is my data format and selcontrasts: the pairs of which I need to contrast the…

Sam Vanbergen
- 145
- 3
- 11
1
vote
1 answer
Matrix of pairwise row operations on pandas.DataFrame
I want to create a matrix of the results of operations on all pairs of rows in a DataFrame.
Here's an example of what I want:
df = pandas.DataFrame({'val': [ 2, 3, 5, 7 ],
'foo': ['f1', 'f2', 'f3', 'f4']},
…

Cai
- 1,726
- 2
- 15
- 24
1
vote
3 answers
how to add two list to make a new matrix
i want to append two list as in order to do a pair wise sort of elements [[-1, -1], [-1, -1], [4, 2], [4, 1]] to make as [[-1, -1], [-1, -1], [4, 1], [4, 2]]
it may be that i append two list [4,1] and [4,2] into a new list but a.append(list) gives…

imshashi17
- 177
- 1
- 3
- 12
1
vote
0 answers
R: 2-way repeated measures ANOVA & pairwise.t.test
Using the example proposed by Field in Discovering Statistics Using R (pag 561) for 1-way repeated measures ANOVA:
Participant <- gl(8, 4, labels = c("P1", "P2", "P3", "P4", "P5", "P6", "P7","P8" ))
Animal <- gl(4, 1, 32, labels =…

Not Sure
- 51
- 5
0
votes
1 answer
R: Create a pairwise matrix of counts of shared values between items in one column and features in another
I have a data thats's a bit like this:
items <- c("A", "A", "A", "A", "B", "B", "B", "C", "C", "C", "C", "C", "D", "D")
features <- c("ab", "ac", "ad", "ab", "ab", "az", "ay", "az", "az", "al", "ab", "ad", "aa", "ac")
df <- data.frame(items,…

Shaun Lehmann
- 25
- 4
0
votes
0 answers
How do I run every possible pairwise comparison using the Wilcoxon Sign-Rank Test when there are more than two levels of a grouping variable?
I have a within-subjects dataset for which I am running pairwise comparisons on a dependent variable that is be separated into four groups. I have the data organized long-ways and wide-ways:
Example…
0
votes
0 answers
Approximate a function given pairwise comparison data of entities with N features
Let's say I'm looking for an apartment with a roommate, and I want to train/discover a model of preferences that my roommate can use to evaluate if I'll like a potential apartment without needing my input.
The dataset has some interval features…

Sarthax
- 73
- 5
0
votes
0 answers
Great Expectations - expect_column_pair_values_to_not_be_equal
Is there a way to achieve the expectation: expect_column_pair_values_to_not_be_equal without having to create a custom expectation. If not what is the easiest way to create a custom expectation doing the desired outcome which is basically a…

PalBence
- 1
- 1
0
votes
0 answers
Investigating if two strains of a virus are more likely than chance to occur together in a person
I am trying to explore if among 13 genotypes of a virus, any 2 are more likely to occur together in pairs in a person who can have multiple infections. my datastructure for this exploration is by visit, i.e a person can have multiple rows, each row…

Sakshi Tewari
- 11
- 2
0
votes
1 answer
Parallelize multiple pairwise comparisons in Python
Consider we have a data frame with 10K rows and 2 columns. The first column is the customer message, and the cnt is the frequency of that message. Below is a sample dataset:
message cnt
0 ABC 1
1 abc 2
2 cba 1
3 abcd …

Sophia
- 377
- 1
- 12
0
votes
0 answers
Threading a pair-wise comparison/change of elements in a vector in Rust
Tried threading work on a vector that requires pair-wise comparison and adjustment of elements in the vector. Instead of using a nested loop, I generate a vector of id's (usize) that are paired off to avoid sending the same id to different…

C. Bartels
- 91
- 6
0
votes
0 answers
Is there a R function to make pairwise correlation tests between 2 different subsets?
I have a dataset (con) divided in 2 groups (A and B) and for each sample from group A (1-5), group B has a correspondent sample (1-5), each sample has different measures (zinc, iron, cadmium) pertaining to it.
My intended goal is making a…

Tig
- 1
0
votes
0 answers
How to calculate the pairwise mutual information (MI) for N number of variables?
I want to compare the mutual information for each possible pair of variables. I want to identify the lower and higher mutual information of all possible combination. I'm not sure if doing the traditional way is correct. Maybe some kind of…

Brayan T
- 1
- 1