pop() for arrays

Hey everyone,
Im trying to make a buffer with a fixed side, essentially I’m popping the first value, then appending the new value to the end of the array.
For some reason pop() doesn’t seem to work and i’m wondering if this simply isnt in this version of Python? If so how would you recommend making this small buffer?

Thanks for your help!
Pierre Louet

What exactly doesn’t work?

I’ve done this before:

list = []
...
list.append(1234)
if len(list) > 4:
    list.remove(0)

This creates a 4 sample buffer.

I have tried this also:
green_line_array.remove(0)
although it says “AttributeError: ‘array’ object has no attribute ‘remove’” which is the same effect as writing pop, could this be a version issue?

Hi, what code are you executing? Did my above code work?

pop() without index removes the last item not the first, try

l.pop(0)