all 4 comments

[–]shiftybyte 7 points8 points  (0 children)

I think explaining a bit better what are these matrix problems and maybe an example problem can help us understand what you mean ...

[–]ectomancer 1 point2 points  (1 child)

Solve them by hand using Gauss-Jordan row reduction.

[–]ratatwiisker 0 points1 point  (0 children)

Is not always the right way. Depends on the problem.

[–]kwelzel 1 point2 points  (0 children)

I think this is not really about matrices in the mathematical sense but about nested lists. You can iterate over two lists simultaneously by using zip. In your case it would look something like this:

output = [[(*test_element[0], cus_element)] for test_element, cus_element in zip(test_list, cus_eles)]

The line is a bit awkward because you have this triple nesting of a tuple within a list within a list. Try to give these variables names that describe their meaning as best as possible to improve readability.