a=[[1,2,3],[4,5,6],[7,8,9]]
.pop () has the ability to not only delete the list item, but also return this item.
I am looking for a similar function that can remove and return the entire list that may exist in the middle of another list.
For example, there is a function that will remove [4,5,6]from the list above aand return it.
The reason for the question is that I sort the list through itemgetterand there is a collision between the header lines (row) and the rest of the data ( datetime). Thus, I am looking to effectively pop up a list that represents the headers, pretend, and then insert it back.
source
share