Skip to content

Commit 868b7d9

Browse files
committed
fix excel related docstring
1 parent 41b2b18 commit 868b7d9

File tree

2 files changed

+153
-129
lines changed

2 files changed

+153
-129
lines changed

pandas/core/generic.py

+28-26
Original file line numberDiff line numberDiff line change
@@ -2008,54 +2008,56 @@ def _repr_data_resource_(self):
20082008
20092009
Parameters
20102010
----------
2011-
excel_writer : string or ExcelWriter object
2011+
excel_writer : str or ExcelWriter object
20122012
File path or existing ExcelWriter.
2013-
sheet_name : string, default 'Sheet1'
2013+
sheet_name : str, default 'Sheet1'
20142014
Name of sheet which will contain DataFrame.
2015-
na_rep : string, default ''
2015+
na_rep : str, default ''
20162016
Missing data representation.
2017-
float_format : string, optional
2017+
float_format : str, optional
20182018
Format string for floating point numbers. For example
20192019
``float_format="%%.2f"`` will format 0.1234 to 0.12.
2020-
columns : sequence or list of string, optional
2020+
columns : sequence or list of str, optional
20212021
Columns to write.
2022-
header : boolean or list of string, default True
2023-
Write out the column names. If a list of strings is given it is
2022+
header : bool or list of str, default True
2023+
Write out the column names. If a list of string is given it is
20242024
assumed to be aliases for the column names.
2025-
index : boolean, default True
2025+
index : bool, default True
20262026
Write row names (index).
2027-
index_label : string or sequence, optional
2027+
index_label : str or sequence, optional
20282028
Column label for index column(s) if desired. If not specified, and
20292029
`header` and `index` are True, then the index names are used. A
20302030
sequence should be given if the DataFrame uses MultiIndex.
2031-
startrow : integer, default 0
2031+
startrow : int, default 0
20322032
Upper left cell row to dump data frame.
2033-
startcol : integer, default 0
2033+
startcol : int, default 0
20342034
Upper left cell column to dump data frame.
2035-
engine : string, optional
2035+
engine : str, optional
20362036
Write engine to use, 'openpyxl' or 'xlsxwriter'. You can also set this
20372037
via the options ``io.excel.xlsx.writer``, ``io.excel.xls.writer``, and
20382038
``io.excel.xlsm.writer``.
2039-
merge_cells : boolean, default True
2039+
merge_cells : bool, default True
20402040
Write MultiIndex and Hierarchical Rows as merged cells.
2041-
encoding : string, optional
2041+
encoding : str, optional
20422042
Encoding of the resulting excel file. Only necessary for xlwt,
20432043
other writers support unicode natively.
2044-
inf_rep : string, default 'inf'
2044+
inf_rep : str, default 'inf'
20452045
Representation for infinity (there is no native representation for
20462046
infinity in Excel).
2047-
verbose : boolean, default True
2047+
verbose : bool, default True
20482048
Display more information in the error logs.
2049-
freeze_panes : tuple of integer (length 2), optional
2049+
freeze_panes : tuple of int (length 2), optional
20502050
Specifies the one-based bottommost row and rightmost column that
20512051
is to be frozen.
20522052
20532053
.. versionadded:: 0.20.0.
20542054
20552055
See Also
20562056
--------
2057-
read_excel
2058-
ExcelWriter
2057+
to_csv : Write DataFrame to a comma-separated values (csv) file.
2058+
ExcelWriter : Class for writing DataFrame objects into excel sheets.
2059+
read_excel : Read an Excel file into a pandas DataFrame.
2060+
read_csv : Read a comma-separated values (csv) file into DataFrame.
20592061
20602062
Notes
20612063
-----
@@ -2071,8 +2073,8 @@ def _repr_data_resource_(self):
20712073
Create, write to and save a workbook:
20722074
20732075
>>> df1 = pd.DataFrame([['a', 'b'], ['c', 'd']],
2074-
... index=['row 1', 'row 2'],
2075-
... columns=['col 1', 'col 2'])
2076+
... index=['row 1', 'row 2'],
2077+
... columns=['col 1', 'col 2'])
20762078
>>> df1.to_excel("output.xlsx") # doctest: +SKIP
20772079
20782080
To specify the sheet name:
@@ -2166,7 +2168,7 @@ def to_json(self, path_or_buf=None, orient=None, date_format=None,
21662168
double_precision : int, default 10
21672169
The number of decimal places to use when encoding
21682170
floating point values.
2169-
force_ascii : boolean, default True
2171+
force_ascii : bool, default True
21702172
Force encoded string to be ASCII.
21712173
date_unit : string, default 'ms' (milliseconds)
21722174
The time unit to encode to, governs timestamp and ISO8601
@@ -2176,7 +2178,7 @@ def to_json(self, path_or_buf=None, orient=None, date_format=None,
21762178
Handler to call if object cannot otherwise be converted to a
21772179
suitable format for JSON. Should receive a single argument which is
21782180
the object to convert and return a serialisable object.
2179-
lines : boolean, default False
2181+
lines : bool, default False
21802182
If 'orient' is 'records' write out line delimited json format. Will
21812183
throw ValueError if incorrect 'orient' since others are not list
21822184
like.
@@ -2192,7 +2194,7 @@ def to_json(self, path_or_buf=None, orient=None, date_format=None,
21922194
.. versionadded:: 0.21.0
21932195
.. versionchanged:: 0.24.0
21942196
'infer' option added and set to default
2195-
index : boolean, default True
2197+
index : bool, default True
21962198
Whether to include the index values in the JSON string. Not
21972199
including the index (``index=False``) is only supported when
21982200
orient is 'split' or 'table'.
@@ -2375,7 +2377,7 @@ def to_msgpack(self, path_or_buf=None, encoding='utf-8', **kwargs):
23752377
----------
23762378
path : string File path, buffer-like, or None
23772379
if None, return generated string
2378-
append : boolean whether to append to an existing msgpack
2380+
append : bool whether to append to an existing msgpack
23792381
(default is False)
23802382
compress : type of compressor (zlib or blosc), default to None (no
23812383
compression)
@@ -2410,7 +2412,7 @@ def to_sql(self, name, con, schema=None, if_exists='fail', index=True,
24102412
* replace: Drop the table before inserting new values.
24112413
* append: Insert new values to the existing table.
24122414
2413-
index : boolean, default True
2415+
index : bool, default True
24142416
Write DataFrame index as a column. Uses `index_label` as the column
24152417
name in the table.
24162418
index_label : string or sequence, default None

0 commit comments

Comments
 (0)