Skip to content

Commit 064aec2

Browse files
committed
DOC: #25723 passing kwargs to excel document engine
1 parent 80bddaf commit 064aec2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/source/user_guide/io.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2864,6 +2864,16 @@ of sheet names can simply be passed to ``read_excel`` with no loss in performanc
28642864
data = pd.read_excel('path_to_file.xls', ['Sheet1', 'Sheet2'],
28652865
index_col=None, na_values=['NA'])
28662866
2867+
If control is needed over how a file is read, an ``xlrd`` workbook
2868+
created with the desired keyword arguments can be passed to ``ExcelFile``.
2869+
2870+
.. code-block:: python
2871+
2872+
xlrd_book = xlrd.open_workbook('path_to_file.xls', on_demand=True)
2873+
with pd.ExcelFile(xlrd_book) as xls:
2874+
df1 = pd.read_excel(xls, 'Sheet1')
2875+
df2 = pd.read_excel(xls, 'Sheet2')
2876+
28672877
.. _io.excel.specifying_sheets:
28682878

28692879
Specifying Sheets

0 commit comments

Comments
 (0)