我正在尝试从 Web 源加载数据并将其保存为 Excel 文件,但不知道该怎么做。我应该怎么办?原始数据框有不同的列。假设我正在尝试保存“打开”列
import matplotlib.pyplot as plt
import pandas_datareader.data as web
import datetime
import pandas as pd
def ViewStockTrend(compcode):
start = datetime.datetime(2015,2,2)
end = datetime.datetime(2016,7,13)
stock = web.DataReader(compcode,'yahoo',start,end)
print(stock['Open'])
compcode = ['FDX','GOOGL','FB']
aa= ViewStockTrend(compcode)