8000 Excel output in non-ascii encodings by jtornero · Pull Request #3710 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Excel output in non-ascii encodings #3710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
0