Numpy has a "convolve" function that can be used in tandem with matplotlib.pyplot to quickly generate running averages. However, depending on the size of your dataset this could be slower than if you wrote a function yourself. For MD simulations, that is probably not a problem.
Numpy has a "convolve" function that can be used in tandem with matplotlib.pyplot to quickly generate running averages. However, depending on the size of your dataset this could be slower than if you wrote a function yourself. For MD simulations, that is probably not a problem.
If I understand correctly, you want to use the running average to go from something like the black line, to the smoothed red line? If so, then Pandas could be your friend here. It has the functions:
pandas.rolling_mean (probably the running average that you want)