circular-buffer

efficient circular buffer?

efficient circular buffer? Question: I want to create an efficient circular buffer in python (with the goal of taking averages of the integer values in the buffer). Is this an efficient way to use a list to collect values? def add_to_buffer( self, num ): self.mylist.pop( 0 ) self.mylist.append( num ) What would be more efficient …

Total answers: 15