利用Python的pandas数据结构来读取excel表格的数据,部分代码如下:
#-*- coding:utf-8 -*-
import pandas as pd
import matplotlib.pyplot as plt
catering_data="catering_sale.xls"
data=pd.read_excel(catering_data,index_col=u'日期')
#读取数据,指定"日期"列为索引列
大多数书上都是这样写的,但是在Python2.7上运行时出现错误。(没有在Python3.x版本试过)
出现了如下问题:
使用help(pd.read_excel)
发现参数中有必选参数sheetname,加入到函数中,代码如下:
#-*- cod