Removing the last data point in python

Hello. I have a function in python where it should delete that last trace in the graph. How would I be able to do this?