Remove first 50 items in a queue

I have a very large list, and I'd like to iteratively remove the first 50 elements without copying it (as for example something like list[50:]).

My initial thought was by doing:

[list.pop(0) for i in range(50)]

What would be the most performant way to do this?



from Recent Questions - Stack Overflow https://ift.tt/3sirdiT
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept