there is a list of this type:

[[585, 671, 2, 588, 143, 144, 1394, 880, 411, 743, 1106, 472, 31, 1398, 33, 34, 1398, 36, 37, 38, 613, 614, 588, 143, 144, 1394, 880, 411, 743, 1106, 472, 31, 1398, 33, 34, 1398, 36, 37, 38], [410, 40, 743, 1403, 43, 917, 1106, 46, 285, 286, 1398, 467, 342, 52, 53, 54, 55]...` Как преобразовать этот list в list из матриц такого вида: [[0, 0, 2, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1], [1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1]... 

where each matrix is ​​the matrix of each list element of the first list

This is a list in which the list elements are also

here is the link to the code: http://pastebin.com/R66xCKAw

Closed due to the fact that the essence of the question is not clear to the participants of MaxU , MBo , insolor , AK , user192664 6 Nov '18 at 6:07 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

1 answer 1

?

 = [[l] in l in lst] 

. . . . . .

  • 2
    If it doesn't bother you, can you formulate a question to which you answered? In the wording of the author of the question, I could not overpower him ... - MaxU
  • @MaxU and I didn’t understand the answer) From the programmer’s point of view, the process of creating an answer can be represented as a function of Answer transform(Question q) which means that some attributes of the question-object pair can be related or the same. That is, an incomprehensible question can be given an incomprehensible answer. For example: someone asked an incomprehensible question and wanted something - transform - I gave out something equally incomprehensible answer and I want to get a tick. In addition, there is a very positive side: the author can say exactly what he does not like, and the whole process will be restarted - Andrio Skur
  • one
    and I almost believed in your telepathic abilities;) I can’t put a tick, but I can put a “+” for an iterative approach in improving the quality of a question ... :-D - MaxU