Questions tagged [pairwise]
273 questions
-1
votes
5 answers
How to create a circular list in one line of code?
Given the following list:
labels = [0, 1, 2, 3, 4]
I wish I could obtain the following by using just one line of code:
pairwise_labels = ['0-1', '1-2', '2-3', '3-4', '4-0']
I can do this with 2 lines of code:
pairwise_labels = [f"{i}-{i+1}" for i…

Rubens Benevides
- 111
- 7
-1
votes
2 answers
How to calculate all pairwise difference for multiple varibles
I need to calculate all pairwise difference for each of these variables (there are 100 in my dataset):
Then I want to summarize (all) the values of each of the pairwise sums and arrange them in a in a matrix.

Juan Almeira
- 101
- 7
-1
votes
1 answer
Assistance in fixing the performance time of algorithmn
The following program is created to perform a pair-wise election over a rank ordered set of ballots.
the end result is to have the pair-wise election completes all test cases in under .01s of elapsed execution time.
Currently the program end result…

Kyle Miller
- 1
- 2
-1
votes
1 answer
Frequency of Correlation Between Two Categorical Pandas Columns
I have two Pandas dataframes, with each unique member_id potentially having numerous rows that list their cars owned and pets owned, respectively. The two DFs have thousands of rows each and their structures look like this (this is a super abstract…

Eddie McGolrick
- 5
- 2
-1
votes
2 answers
Create dyadic pairwise dataset based on conditions
I have a monadic dataset that looks something like this:
df<-structure(list(Number = c("375_1", "375_1", "375_1", "375_1",
"375_1", "375_1", "375_1", "375_1", "647_1", "647_1", "647_1",
"647_1", "647_1", "647_1", "647_1", "647_1", "647_1",…

Alex
- 1,207
- 9
- 25
-1
votes
2 answers
How to find the minimum distance .. when two points belongs to same distance
I have a dataframe like this:
A B
1 0.1
1 0.2
1 0.3
2 0.2
2 0.5
2 0.3
3 0.8
3 0.6
3 0.1
How can I find the minimum value belonging to each point 1,2,3 and there should be no conflict which means point 1 and 2 should not belong to same point…

sara
- 45
- 2
- 13
-1
votes
2 answers
Compare lists pairwise and return only the values that are greater in list1
Is there a way in python, to compare a value in one list with the value of the same index in a second list?
For example: I want to see if the value in list1[0] > list2[0] and list1[1] > list2[1] and do that for the entire list, but return only the…

PyPro
- 41
- 2
- 6
-1
votes
2 answers
Pairwise table into a Nodes and edges table for import into NEO4J or Cytoscape
How can I transform a CSV pairwise co-publication correlation table (165 names by the same 165 names w/ correlation values) into a file I can import as a nodes and edges table into either NEO4J or Cytoscape?
-1
votes
2 answers
How to get an alignment score from DNA sequences?
I'm somewhat familiar with Biopython's pairwise2 function but I noticed that it adds dashes within the sequence in order to obtain the best possible alignment score. For example,
for a in pairwise2.align.globalxx("ACCGT", "ACG"):
…

superasiantomtom95
- 521
- 1
- 7
- 25
-2
votes
1 answer
Frequency of elements in pairwise comparison of lists within a list in Python
I have a list of lists like this:
my_list_of_lists =
[['sparrow','sparrow','sparrow','junco','jay','robin'],
['sparrow','sparrow','junco', 'sparrow','robin','robin'],
['sparrow','sparrow','sparrow','sparrow','jay','robin']]
I would like to do a…

user14278898
- 53
- 6
-2
votes
1 answer
non-element wise pairing of array in a list
let's say i have a list , list=[[0,1,2],[1,2,0],[2,1,3],[3,1,2]]. i want to match and group the arrays position in the list which has same numbers in spite of their position and get their indices.
for example my code should give [0,1,2] and…

Surya Venkatesh
- 1
- 1
-2
votes
1 answer
Pairwise sequence analysis - finding indexes of unique combinations
I have a large list of DNA sequences {A,C,T,G} (total of 100,000 lists, each with 3000 characters). I need to analyse these lists in pairs, starting with the 1st list and comparing it with the 2nd, 3rd, 4th, ..., 100,000th. Then move on to the 2nd…

Sudaraka
- 125
- 7
-2
votes
1 answer
How to check that all elements in a list are unique
How can i write a program to check that all elements in a list are unique.
I have a list that is entered by the user and i would like the program to check that the elements are unique, if they are, say list=[1,2,3,4,5], then the program continues.…

janthony
- 1
-2
votes
3 answers
Python - Pairwise intersection of multiple lists, then sum up all duplicates
a = [1,2,3]
b = [2,3,4]
c = [1,2,4]
d = [1,3,6]
Hi, all,
I have the above lists, I'd like to show pairwise intersection/overlap (# of duplicated integers) of the each two lists like the following format. Any one knows how to achieve this? (any…

Sean Lu
- 61
- 9
-2
votes
1 answer
Deleting one of properties and creating it as new node under fulfilling condition
I am new to Neo4j world, I have imported a big csv file into Neo4j including following headers:(so now every row of csv has following properties in neo4j and obj1 as node label)
obj1, obj2, method1, method2, method3
method 1 to 3 have float values…

shafigh
- 61
- 1
- 2
- 10