@@ -458,22 +458,53 @@ def to_sparse(self, fill_value=None, kind='block'):
458458 default_kind = kind ,
459459 default_fill_value = fill_value )
460460
461- def to_excel (self , path , na_rep = '' ):
461+ def to_excel (self , path , na_rep = '' , engine = None , ** kwargs ):
462462 """
463463 Write each DataFrame in Panel to a separate excel sheet
464464
465465 Parameters
466466 ----------
467- excel_writer : string or ExcelWriter object
467+ path : string or ExcelWriter object
468468 File path or existing ExcelWriter
469469 na_rep : string, default ''
470470 Missing data representation
471+ engine : string, default None
472+ write engine to use - you can also set this via the options
473+ ``io.excel.xlsx.writer``, ``io.excel.xls.writer``, and
474+ ``io.excel.xlsm.writer``.
475+
476+ Keyword Arguments
477+ -----------------
478+ float_format : string, default None
479+ Format string for floating point numbers
480+ cols : sequence, optional
481+ Columns to write
482+ header : boolean or list of string, default True
483+ Write out column names. If a list of string is given it is
484+ assumed to be aliases for the column names
485+ index : boolean, default True
486+ Write row names (index)
487+ index_label : string or sequence, default None
488+ Column label for index column(s) if desired. If None is given, and
489+ `header` and `index` are True, then the index names are used. A
490+ sequence should be given if the DataFrame uses MultiIndex.
491+ startow : upper left cell row to dump data frame
492+ startcol : upper left cell column to dump data frame
493+
494+ Keyword arguments (and na_rep) are passed to the ``to_excel`` method
495+ for each DataFrame written.
471496 """
472497 from pandas .io .excel import ExcelWriter
473- writer = ExcelWriter (path )
498+
499+ if isinstance (path , compat .string_types ):
500+ writer = ExcelWriter (path , engine = engine )
501+ else :
502+ writer = path
503+ kwargs ['na_rep' ] = na_rep
504+
474505 for item , df in compat .iteritems (self ):
475506 name = str (item )
476- df .to_excel (writer , name , na_rep = na_rep )
507+ df .to_excel (writer , name , ** kwargs )
477508 writer .save ()
478509
479510 def as_matrix (self ):
0 commit comments