xlsxwriter使用pandas使用python 3.3发布

时间:2014-03-08 12:07:28

标签: python pandas xlsxwriter

努力让xlxswriter创建多个工作表并使用pandas df.to_excel方法将数据放在那里。

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import xlsxwriter
import os as os
import sqlite3 as sql
import xlrd

path = (r'C:\Users\test1\Downloads\category.xlsx') #folder

data = pd.DataFrame()
data = pd.read_excel(path,sheetname='1')
print (data.shape)
data.head()

#create excel workbook using xlsxwriter
#workbook = xlsxwriter.Workbook('hyperlink.xlsx')
writer = ExcelWriter('hyperlink.xlsx')
data.to_excel(writer,'Sheet1')
workbook.close()

0 个答案:

没有答案