#來捉一下yahoo股票 台股2330(台G電) import pandas as pd import pandas.io.data as web import datetime #下載起始日期 start=datetime.datetime(2016,11,1) end=datetime.datetime(2016,11,20) #股票代號 df=web.DataReader('2330.tw','yahoo',start,end) #日股價寫入excel檔 writer=pd.ExcelWriter('2330.xlsx') df.to_excel(writer,'2330') workbook=writer.book worksheet=writer.sheets['2330'] writer.save() print "finish"
執完完畢的2330.xlsx
相關資料:
Python Data Analysis Library
沒有留言:
張貼留言