...
Code Block |
---|
import matplotlib
matplotlib.use('Agg')
import pandas as pd
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import os
samsung = pd.read_csv('http://qsok.com/test/py/005930.csv')
# samsung.set_index( 'Date', inplace=True)
print("<pre>")
print(samsung)
print("\n")
max_date = samsung['Date'].max()
print('Last date of record stored %s' % max_date)
print("</pre>")
if not os.path.exists('./samsung_stock_price.png'):
plt.plot(samsung['Date'], samsung['Close'])
plt.xlabel('Date')
plt.ylabel('Close')
plt.title('Experiment Result')
plt.savefig('samsung_stock_price.png')
print("<img src=samsung_stock_price.png>")
|
...