Skip to content
Prev Previous commit
Next Next commit
Added support for encodings other than ascii when exporting to Excel …
…using xlwt, also for output without ExcelWriter - just filename - final
  • Loading branch information
jtornero committed May 29, 2013
commit 8bf91ff3acdee0db313a4cf79df38d8cc03361b7
4 changes: 2 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ def to_csv(self, path_or_buf, sep=",", na_rep='', float_format=None,
tupleize_cols=tupleize_cols)
formatter.save()

def to_excel(self, excel_writer, enc = 'ascii', sheet_name='sheet1', na_rep='',
def to_excel(self, excel_writer, encoding = 'ascii', sheet_name='sheet1', na_rep='',
float_format=None, cols=None, header=True, index=True,
index_label=None, startrow=0, startcol=0):
"""
Expand Down Expand Up @@ -1513,7 +1513,7 @@ def to_excel(self, excel_writer, enc = 'ascii', sheet_name='sheet1', na_rep='',
from pandas.io.parsers import ExcelWriter
need_save = False
if isinstance(excel_writer, basestring):
excel_writer = ExcelWriter(excel_writer, encoding=enc)
excel_writer = ExcelWriter(excel_writer, encoding=encoding)
need_save = True

formatter = fmt.ExcelFormatter(self,
Expand Down