Created
November 18, 2017 21:32
-
-
Save vvksh/8ba7ee7489bd8ec50c995f6216adcb7d to your computer and use it in GitHub Desktop.
plot of rolling mean using pandas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#say `x` is list of noisy values | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
x = np.random.uniform(size=100) | |
mean_x = pd.Series(x).rolling(window=2).mean() | |
itr = range(len(mean_x)) | |
plt.xlabel("iterations") | |
plt.ylabel("X") | |
plt.title("Rolling Mean") | |
plt.plot(itr, new_x) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment