repl.it
@ebest/

Stock plot

Python

No description

fork
loading
Files
  • main.py
  • plt.png
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import datetime as dt
import matplotlib.pyplot as plt
from matplotlib import style
import pandas as pd
import pandas_datareader.data as web

style.use('ggplot')

start = dt.datetime(2015, 1, 1)
end = dt.datetime.now()
df = web.DataReader("GOOG", 'yahoo', start, end)
df.reset_index(inplace=True)
df.set_index("Date", inplace=True)
print(df)
ax = df.plot()
fig = ax.get_figure()
fig.savefig('plt.png')
?