Skip to content

Commit 50843bc

Browse files
committed
DOC: inline docstrings for read_excel with proper formatting
1 parent 5ddcd06 commit 50843bc

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

pandas/io/excel/_base.py

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def read_excel(
227227
* ``1``: 2nd sheet as a `DataFrame`
228228
* ``"Sheet1"``: Load sheet with name "Sheet1"
229229
* ``[0, 1, "Sheet5"]``: Load first, second and sheet named "Sheet5"
230-
as a dict of `DataFrame`
230+
as a dict of `DataFrame`
231231
* ``None``: All worksheets.
232232
233233
header : int, list of int, default 0
@@ -254,12 +254,13 @@ def read_excel(
254254
and column ranges (e.g. "A:E" or "A,C,E:F"). Ranges are inclusive of
255255
both sides.
256256
* If list of int, then indicates list of column numbers to be parsed
257-
(0-indexed).
257+
(0-indexed).
258258
* If list of string, then indicates list of column names to be parsed.
259259
* If callable, then evaluate each column name against it and parse the
260260
column if the callable returns ``True``.
261261
262262
Returns a subset of the columns according to behavior above.
263+
263264
dtype : Type name or dict of column -> type, default None
264265
Data type for data or columns. E.g. {'a': np.float64, 'b': np.int32}
265266
Use ``object`` to preserve data as stored in Excel and not interpret dtype,
@@ -285,6 +286,7 @@ def read_excel(
285286
- Otherwise if ``path_or_buffer`` is an xls format, ``xlrd`` will be used.
286287
- Otherwise if ``path_or_buffer`` is in xlsb format, ``pyxlsb`` will be used.
287288
- Otherwise ``openpyxl`` will be used.
289+
288290
converters : dict, default None
289291
Dict of functions for converting values in certain columns. Keys can
290292
either be integers or column labels, values are functions that take one
@@ -999,14 +1001,14 @@ class ExcelWriter(Generic[_WorkbookT]):
9991001
mode : {{'w', 'a'}}, default 'w'
10001002
File mode to use (write or append). Append does not work with fsspec URLs.
10011003
storage_options : dict, optional
1002-
Extra options that make sense for a particular storage connection, e.g.
1003-
host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
1004-
are forwarded to ``urllib.request.Request`` as header options. For other
1005-
URLs (e.g. starting with "s3://", and "gcs://") the key-value pairs are
1006-
forwarded to ``fsspec.open``. Please see ``fsspec`` and ``urllib`` for more
1007-
details, and for more examples on storage options refer `here
1008-
<https://pandas.pydata.org/docs/user_guide/io.html?
1009-
highlight=storage_options#reading-writing-remote-files>`_.
1004+
Extra options that make sense for a particular storage connection, e.g.
1005+
host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
1006+
are forwarded to ``urllib.request.Request`` as header options. For other
1007+
URLs (e.g. starting with "s3://", and "gcs://") the key-value pairs are
1008+
forwarded to ``fsspec.open``. Please see ``fsspec`` and ``urllib`` for more
1009+
details, and for more examples on storage options refer `here
1010+
<https://pandas.pydata.org/docs/user_guide/io.html?
1011+
highlight=storage_options#reading-writing-remote-files>`_.
10101012
10111013
if_sheet_exists : {{'error', 'new', 'replace', 'overlay'}}, default 'error'
10121014
How to behave when trying to write to a sheet that already
@@ -1443,14 +1445,14 @@ def inspect_excel_format(
14431445
content_or_path : str or file-like object
14441446
Path to file or content of file to inspect. May be a URL.
14451447
storage_options : dict, optional
1446-
Extra options that make sense for a particular storage connection, e.g.
1447-
host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
1448-
are forwarded to ``urllib.request.Request`` as header options. For other
1449-
URLs (e.g. starting with "s3://", and "gcs://") the key-value pairs are
1450-
forwarded to ``fsspec.open``. Please see ``fsspec`` and ``urllib`` for more
1451-
details, and for more examples on storage options refer `here
1452-
<https://pandas.pydata.org/docs/user_guide/io.html?
1453-
highlight=storage_options#reading-writing-remote-files>`_.
1448+
Extra options that make sense for a particular storage connection, e.g.
1449+
host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
1450+
are forwarded to ``urllib.request.Request`` as header options. For other
1451+
URLs (e.g. starting with "s3://", and "gcs://") the key-value pairs are
1452+
forwarded to ``fsspec.open``. Please see ``fsspec`` and ``urllib`` for more
1453+
details, and for more examples on storage options refer `here
1454+
<https://pandas.pydata.org/docs/user_guide/io.html?
1455+
highlight=storage_options#reading-writing-remote-files>`_.
14541456
14551457
Returns
14561458
-------
@@ -1542,16 +1544,16 @@ class ExcelFile:
15421544
Please do not report issues when using ``xlrd`` to read ``.xlsx`` files.
15431545
This is not supported, switch to using ``openpyxl`` instead.
15441546
storage_options : dict, optional
1545-
Extra options that make sense for a particular storage connection, e.g.
1546-
host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
1547-
are forwarded to ``urllib.request.Request`` as header options. For other
1548-
URLs (e.g. starting with "s3://", and "gcs://") the key-value pairs are
1549-
forwarded to ``fsspec.open``. Please see ``fsspec`` and ``urllib`` for more
1550-
details, and for more examples on storage options refer `here
1551-
<https://pandas.pydata.org/docs/user_guide/io.html?
1552-
highlight=storage_options#reading-writing-remote-files>`_.
1553-
engine_kwargs : dict, optional
1554-
Arbitrary keyword arguments passed to excel engine.
1547+
Extra options that make sense for a particular storage connection, e.g.
1548+
host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
1549+
are forwarded to ``urllib.request.Request`` as header options. For other
1550+
URLs (e.g. starting with "s3://", and "gcs://") the key-value pairs are
1551+
forwarded to ``fsspec.open``. Please see ``fsspec`` and ``urllib`` for more
1552+
details, and for more examples on storage options refer `here
1553+
<https://pandas.pydata.org/docs/user_guide/io.html?
1554+
highlight=storage_options#reading-writing-remote-files>`_.
1555+
engine_kwargs : dict, optional
1556+
Arbitrary keyword arguments passed to excel engine.
15551557
15561558
See Also
15571559
--------

0 commit comments

Comments
 (0)