import pandas as pd
df = pd.read_csv("FinanceData.csv")
print(df.shape)
print(df.columns)
print(df.head())
df.set_index(["time"],inplace=True)
print(df.head())
# df.pct_change returns the percent change over a given number of periods.
df_pct = df.pct_change().dropna()*100
df_pct.head()
df_pct.mean()
df_pct.std()
df_pct.rolling(30).mean().dropna()
df_pct.rolling(30).std().dropna()
df_pct.corr()
df_corr = df_pct.copy()
df_mean = df_corr.rolling(30).mean().dropna()
df_std = df_corr.rolling(30).std().dropna()
print(df.shape)
print(df_mean.head())
df_corr -= df_corr.rolling(30).mean()
df_corr.corr()