Linked Questions
12 questions linked to/from How to compare a list of lists/sets in python?
3
votes
1
answer
450
views
Find difference between two 2D array in python [duplicate]
How do I find the difference between two 2D array in python ?
First array and second array
arr1 = [[1,1],[1,2],[1,3],[1,4],[1,5]]
arr2 = [[1,2],[1,3],[1,4]]
The result I want
result = [[1,1],[1,5]]
1268
votes
33
answers
1.6m
views
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 ...
361
votes
6
answers
587k
views
Understanding the map function
The Python 2 documentation says:
Built-in Functions: map(function, iterable, ...)
Apply function to every item of iterable and return a list of the
results. If additional iterable arguments are ...
10
votes
2
answers
31k
views
How do I compare 2D lists for equality in Python?
Given two lists:
a = [[1,2],[3,4]]
b = [[1,2],[3,4]]
How would I write compare such that:
compare(a,b) => true
0
votes
3
answers
3k
views
How to compare list of lists in Python?
I have 2 lists like the following:
a=[[1,0,1,0,1],[0,0,0,1,0],[1,1,0,0,0]]
b=[[1,0,0,0,1],[0,1,0,1,0],[1,1,0,1,0]]
I want to return true if all the sublists in b are present in a and vice versa.
That ...
0
votes
3
answers
192
views
Python - Comparison of list of lists with approximating floats
I'm kinda new to programming and I want to compare two lists of lists in python, while the floats in these lists may have an error in it. Here an example:
first_list = [['ATOM', 'N', 'SER', -1.081, -...
0
votes
2
answers
91
views
How can I compare two lists and m python. - Capture the different value
I am trying to compare two lists in python, one of them is a response from a rest request that I stored in a list and the other is obtained through a csv file.
I need to compare them and capture the ...
-1
votes
1
answer
112
views
Python 2.7 Removing Duplicate Elements in a List of Lists compared to another List of Lists
I am trying to take two List of Lists and compare them against each other. From my research the closest I have found was this How to compare a list of lists/sets in python?. I am trying to do ...
1
vote
1
answer
89
views
Fastest method for comparing ranges of multidimensional lists
Context: I am trying to write an A* search in an unknown environment. To do this, I am maintaining a representation of the environment in a 2-D or 3-D list (depending on the environment), and another ...
0
votes
2
answers
81
views
Fastest way to compare Array-of-array?
I have array-of-arrays like the ones below :
[[0, 3], [0, 4, 1, 5], [0, 2]]
[[0, 4, 1, 5], [0, 3], [0, 2]]
[[0, 2], [0, 4, 1, 5], [0, 3]]
[[0, 4, 1, 5, 3], [0, 2]]
[[0, 4, 1, 5, 3, 2]]
If you look ...
-1
votes
1
answer
76
views
Difference between two multiple arrays by the index in PYTHON
Hi guys i just start to programming and im trying to get this right.
A = [['1','Jack','33'], ['2','Maria','23'], ['3','Christian','9'] ]
B = [['1','Jack','33'], ['2','Maria','23'], ['3','Christian','...
-1
votes
1
answer
38
views
Compare single element in two lists of lists and output the lists that do not match
I have 2 csv files. I am reading each of them into 2 separate list of lists.
Example: Each csv has 3 columns ['Device', 'User', 'Email']
Edit: I need to keep each list of 3 elements ONLY if element[0] ...