Last active
June 25, 2019 15:15
-
-
Save sachinsdate/1011ee0886b0d93777842b5acad8d36e to your computer and use it in GitHub Desktop.
This file contains 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
import matplotlib.pyplot as plt | |
import pandas as pd | |
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf | |
import seaborn as sns | |
df = pd.read_csv('boston_monthly_tmax_1998_2019.csv', header=0, infer_datetime_format=True, parse_dates=[0], index_col=[0]) | |
df.plot(marker='.') | |
plt.show() | |
for i in range(1, 12+1): | |
df['TMINUS' + str(i)] = df['Monthly Average Maximum'].shift(i) | |
for i in range(1, 12+1): | |
ax = plt.subplot(4, 3, i) | |
ax.set_title('LAG ' + str(i), fontdict={'fontsize': 10}) | |
plt.scatter(x=df['Monthly Average Maximum'].values, y=df['TMINUS' + str(i)].values, marker='.') | |
plt.show() | |
corr = df.corr() | |
sns.heatmap(corr, xticklabels=corr.columns,yticklabels=corr.columns) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment