Skip to content

Commit 0068abf

Browse files
committed
DEPR: Remove unused keyword kind in read_excel/ExcelFile, pandas-dev#4712
1 parent 69271b3 commit 0068abf

File tree

2 files changed

+31
-36
lines changed

2 files changed

+31
-36
lines changed

doc/source/whatsnew/v0.17.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ Removal of prior version deprecations/changes
709709

710710

711711
- Remove the ``table`` keyword in ``HDFStore.put/append``, in favor of using ``format=`` (:issue:`4645`)
712-
712+
- Remove unused keyword ``kind`` in ``read_excel/ExcelFile`` (:issue:`4712`)
713713

714714

715715
.. _whatsnew_0170.performance:

pandas/io/excel.py

+30-35
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ def read_excel(io, sheetname=0, **kwds):
7878
and file. For file URLs, a host is expected. For instance, a local
7979
file could be file://localhost/path/to/workbook.xlsx
8080
sheetname : string, int, mixed list of strings/ints, or None, default 0
81-
82-
Strings are used for sheet names, Integers are used in zero-indexed sheet
83-
positions.
84-
81+
82+
Strings are used for sheet names, Integers are used in zero-indexed sheet
83+
positions.
84+
8585
Lists of strings/integers are used to request multiple sheets.
86-
86+
8787
Specify None to get all sheets.
88-
88+
8989
str|int -> DataFrame is returned.
9090
list|None -> Dict of DataFrames is returned, with keys representing sheets.
91-
91+
9292
Available Cases
9393
9494
* Defaults to 0 -> 1st sheet as a DataFrame
@@ -143,11 +143,6 @@ def read_excel(io, sheetname=0, **kwds):
143143
for more information on when a Dict of Dataframes is returned.
144144
145145
"""
146-
if 'kind' in kwds:
147-
kwds.pop('kind')
148-
warn("kind keyword is no longer supported in read_excel and may be "
149-
"removed in a future version", FutureWarning)
150-
151146
engine = kwds.pop('engine', None)
152147

153148
return ExcelFile(io, engine=engine).parse(sheetname=sheetname, **kwds)
@@ -207,19 +202,19 @@ def parse(self, sheetname=0, header=0, skiprows=None, skip_footer=0,
207202
Parameters
208203
----------
209204
sheetname : string, int, mixed list of strings/ints, or None, default 0
210-
211-
Strings are used for sheet names, Integers are used in zero-indexed sheet
212-
positions.
213-
205+
206+
Strings are used for sheet names, Integers are used in zero-indexed sheet
207+
positions.
208+
214209
Lists of strings/integers are used to request multiple sheets.
215-
210+
216211
Specify None to get all sheets.
217-
212+
218213
str|int -> DataFrame is returned.
219214
list|None -> Dict of DataFrames is returned, with keys representing sheets.
220-
215+
221216
Available Cases
222-
217+
223218
* Defaults to 0 -> 1st sheet as a DataFrame
224219
* 1 -> 2nd sheet as a DataFrame
225220
* "Sheet1" -> 1st sheet as a DataFrame
@@ -336,7 +331,7 @@ def _parse_excel(self, sheetname=0, header=0, skiprows=None, skip_footer=0,
336331
def _parse_cell(cell_contents,cell_typ):
337332
"""converts the contents of the cell into a pandas
338333
appropriate object"""
339-
334+
340335
if cell_typ == XL_CELL_DATE:
341336
if xlrd_0_9_3:
342337
# Use the newer xlrd datetime handling.
@@ -379,9 +374,9 @@ def _parse_cell(cell_contents,cell_typ):
379374
xlrd_0_9_3 = True
380375
else:
381376
xlrd_0_9_3 = False
382-
377+
383378
ret_dict = False
384-
379+
385380
#Keep sheetname to maintain backwards compatibility.
386381
if isinstance(sheetname, list):
387382
sheets = sheetname
@@ -391,31 +386,31 @@ def _parse_cell(cell_contents,cell_typ):
391386
ret_dict = True
392387
else:
393388
sheets = [sheetname]
394-
389+
395390
#handle same-type duplicates.
396391
sheets = list(set(sheets))
397-
392+
398393
output = {}
399-
394+
400395
for asheetname in sheets:
401396
if verbose:
402397
print("Reading sheet %s" % asheetname)
403-
398+
404399
if isinstance(asheetname, compat.string_types):
405400
sheet = self.book.sheet_by_name(asheetname)
406-
else: # assume an integer if not a string
407-
sheet = self.book.sheet_by_index(asheetname)
408-
401+
else: # assume an integer if not a string
402+
sheet = self.book.sheet_by_index(asheetname)
403+
409404
data = []
410405
should_parse = {}
411-
406+
412407
for i in range(sheet.nrows):
413408
row = []
414409
for j, (value, typ) in enumerate(zip(sheet.row_values(i),
415410
sheet.row_types(i))):
416411
if parse_cols is not None and j not in should_parse:
417412
should_parse[j] = self._should_parse(j, parse_cols)
418-
413+
419414
if parse_cols is None or should_parse[j]:
420415
row.append(_parse_cell(value,typ))
421416
data.append(row)
@@ -436,14 +431,14 @@ def _parse_cell(cell_contents,cell_typ):
436431
skip_footer=skip_footer,
437432
chunksize=chunksize,
438433
**kwds)
439-
434+
440435
output[asheetname] = parser.read()
441-
436+
442437
if ret_dict:
443438
return output
444439
else:
445440
return output[asheetname]
446-
441+
447442

448443
@property
449444
def sheet_names(self):

0 commit comments

Comments
 (0)