|
105 | 105 | axes_single_arg="{0 or 'index', 1 or 'columns'}", |
106 | 106 | optional_by=""" |
107 | 107 | by : str or list of str |
108 | | - Name or list of names which refer to the axis items.""") |
| 108 | + Name or list of names which refer to the axis items.""", |
| 109 | + versionadded_to_excel='') |
109 | 110 |
|
110 | 111 | _numeric_only_doc = """numeric_only : boolean, default None |
111 | 112 | Include only float, int, boolean data. If None, will attempt to use |
@@ -1385,65 +1386,11 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None, |
1385 | 1386 | if path_or_buf is None: |
1386 | 1387 | return formatter.path_or_buf.getvalue() |
1387 | 1388 |
|
| 1389 | + @Appender(_shared_docs['to_excel'] % _shared_doc_kwargs) |
1388 | 1390 | def to_excel(self, excel_writer, sheet_name='Sheet1', na_rep='', |
1389 | 1391 | float_format=None, columns=None, header=True, index=True, |
1390 | 1392 | index_label=None, startrow=0, startcol=0, engine=None, |
1391 | 1393 | 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 | 1394 | from pandas.io.excel import ExcelWriter |
1448 | 1395 | need_save = False |
1449 | 1396 | if encoding is None: |
|
0 commit comments