@@ -1385,65 +1385,11 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
1385
1385
if path_or_buf is None :
1386
1386
return formatter .path_or_buf .getvalue ()
1387
1387
1388
+ @Appender (_shared_docs ['to_excel' ] % _shared_doc_kwargs )
1388
1389
def to_excel (self , excel_writer , sheet_name = 'Sheet1' , na_rep = '' ,
1389
1390
float_format = None , columns = None , header = True , index = True ,
1390
1391
index_label = None , startrow = 0 , startcol = 0 , engine = None ,
1391
1392
merge_cells = True , encoding = None , inf_rep = 'inf' , verbose = True ):
1392
- """
1393
- Write DataFrame to a excel sheet
1394
-
1395
- Parameters
1396
- ----------
1397
- excel_writer : string or ExcelWriter object
1398
- File path or existing ExcelWriter
1399
- sheet_name : string, default 'Sheet1'
1400
- Name of sheet which will contain DataFrame
1401
- na_rep : string, default ''
1402
- Missing data representation
1403
- float_format : string, default None
1404
- Format string for floating point numbers
1405
- columns : sequence, optional
1406
- Columns to write
1407
- header : boolean or list of string, default True
1408
- Write out column names. If a list of string is given it is
1409
- assumed to be aliases for the column names
1410
- index : boolean, default True
1411
- Write row names (index)
1412
- index_label : string or sequence, default None
1413
- Column label for index column(s) if desired. If None is given, and
1414
- `header` and `index` are True, then the index names are used. A
1415
- sequence should be given if the DataFrame uses MultiIndex.
1416
- startrow :
1417
- upper left cell row to dump data frame
1418
- startcol :
1419
- upper left cell column to dump data frame
1420
- engine : string, default None
1421
- write engine to use - you can also set this via the options
1422
- ``io.excel.xlsx.writer``, ``io.excel.xls.writer``, and
1423
- ``io.excel.xlsm.writer``.
1424
- merge_cells : boolean, default True
1425
- Write MultiIndex and Hierarchical Rows as merged cells.
1426
- encoding: string, default None
1427
- encoding of the resulting excel file. Only necessary for xlwt,
1428
- other writers support unicode natively.
1429
- inf_rep : string, default 'inf'
1430
- Representation for infinity (there is no native representation for
1431
- infinity in Excel)
1432
-
1433
- Notes
1434
- -----
1435
- If passing an existing ExcelWriter object, then the sheet will be added
1436
- to the existing workbook. This can be used to save different
1437
- DataFrames to one workbook:
1438
-
1439
- >>> writer = ExcelWriter('output.xlsx')
1440
- >>> df1.to_excel(writer,'Sheet1')
1441
- >>> df2.to_excel(writer,'Sheet2')
1442
- >>> writer.save()
1443
-
1444
- For compatibility with to_csv, to_excel serializes lists and dicts to
1445
- strings before writing.
1446
- """
1447
1393
from pandas .io .excel import ExcelWriter
1448
1394
need_save = False
1449
1395
if encoding is None :
0 commit comments