Skip to content

Instantly share code, notes, and snippets.

@marcopeix
Created August 6, 2019 18:01
Show Gist options
  • Save marcopeix/159ef4faf83c8e93b8ca398f77b551d3 to your computer and use it in GitHub Desktop.
Save marcopeix/159ef4faf83c8e93b8ca398f77b551d3 to your computer and use it in GitHub Desktop.
# Make a dataframe containing actual and predicted prices
comparison = pd.DataFrame({'actual': [18.93, 19.23, 19.08, 19.17, 19.11, 19.12],
'predicted': [18.96, 18.97, 18.96, 18.92, 18.94, 18.92]},
index = pd.date_range(start='2018-06-05', periods=6,))
#Plot predicted vs actual price
plt.figure(figsize=(17, 8))
plt.plot(comparison.actual)
plt.plot(comparison.predicted)
plt.title('Predicted closing price of New Germany Fund Inc (GF)')
plt.ylabel('Closing price ($)')
plt.xlabel('Trading day')
plt.legend(loc='best')
plt.grid(False)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment