Skip to content
Next Next commit
Added support for encodings other than ascii when exporting to Excel …
…using xlwt
  • Loading branch information
jtornero committed May 29, 2013
commit d669e5cd493aef48f8afba62bec5e42f8585a96d
5 changes: 3 additions & 2 deletions pandas/io/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2264,12 +2264,13 @@ class ExcelWriter(object):
path : string
Path to xls file
"""
def __init__(self, path):
def __init__(self, path, encoding = 'ascii'):
self.use_xlsx = True
self.encoding = encoding
if path.endswith('.xls'):
self.use_xlsx = False
import xlwt
self.book = xlwt.Workbook()
self.book = xlwt.Workbook(encoding = self.encoding)
self.fm_datetime = xlwt.easyxf(
num_format_str='YYYY-MM-DD HH:MM:SS')
self.fm_date = xlwt.easyxf(num_format_str='YYYY-MM-DD')
Expand Down