https://youtu.be/8mnLZGNrAzM?list=PLQVvvaa0QuDc-3szzjeP6N6b0aDrrKyL-
In [1]:
import quandl;
import pandas as pd;
import pickle;
import matplotlib.pyplot as plt;
from matplotlib import style;
style.use("fivethirtyeight");
In [3]:
bridge_height = {'meters':[10.26, 10.31, 10.27, 10.22, 10.23, 6212.42, 10.28, 10.25, 10.31]};
# it seems that 6212.42 - the wrong data
df = pd.DataFrame(bridge_height);
df.plot();
plt.show();
In [6]:
df["STD"] = df["meters"].rolling(window = 2).std(); # standart diviation (square mean: root(sum / count))
df.plot();
plt.show();
In [12]:
df_std = df.describe();
print(df_std);
df_std = df.describe()["meters"]["std"];
print(df_std);
In [22]:
print(df["STD"] < df_std) # wow
In [24]:
print(df[df["STD"] < df_std]) # wow wow
junk_free_df = df[df["STD"] < df_std];
In [25]:
junk_free_df.plot();
plt.show();
In [ ]: