Linked Questions

3 votes
1 answer
450 views

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]]
Jeremy's user avatar
  • 55
1268 votes
33 answers
1.6m views

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 ...
Max Frai's user avatar
  • 64.6k
361 votes
6 answers
587k views

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 ...
Web Master's user avatar
  • 4,370
10 votes
2 answers
31k views

Given two lists: a = [[1,2],[3,4]] b = [[1,2],[3,4]] How would I write compare such that: compare(a,b) => true
sdasdadas's user avatar
  • 25.4k
0 votes
3 answers
3k views

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 ...
hahahj's user avatar
  • 1
0 votes
3 answers
192 views

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, -...
Bugsy's user avatar
  • 75
0 votes
2 answers
91 views

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 ...
Bruno Lorena's user avatar
-1 votes
1 answer
112 views

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 ...
divdeamor's user avatar
1 vote
1 answer
89 views

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 ...
Teknophilia's user avatar
0 votes
2 answers
81 views

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 ...
sten's user avatar
  • 7,536
-1 votes
1 answer
76 views

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','...
Cícero Cunha's user avatar
-1 votes
1 answer
38 views

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] ...
Kevlar_Axis's user avatar