Need help that I got lost in zipping two lists of lists (matrix).
The matrices that exactly the same format, that I would like them to be zipped in tuple pairs for each element in the same position.
For example,
m1 = [['A', 'B', 'C'],
['D', 'E'],
['F', 'G']]
m2 = [['s1', 's2', 's3'],
['s4', 's5'],
['s1', 's3']]
What I expect to get is, with the same format:
z = [[('A', 's1'), ('B', 's2'), ('C', 's3')],
[('D', 's4'), ('E', 's5')],
[('F', 's1'), ('G', 's3')]]
I can write a function to do this but I am looking for an elegant way of doing this in Python.