Skip to content

Commit 4532fe4

Browse files
committed
Merge pull request #4713 from jtratner/remove-kind-parameter-read-excel
CLN: Remove unused and undocumented kind keyword from read_excel
2 parents 41d10b5 + 2868a09 commit 4532fe4

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

doc/source/release.rst

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ See :ref:`Internal Refactoring<whatsnew_0130.refactoring>`
212212
- Refactor of ``_get_numeric_data/_get_bool_data`` to core/generic.py, allowing Series/Panel functionaility
213213
- Refactor of Series arithmetic with time-like objects (datetime/timedelta/time
214214
etc.) into a separate, cleaned up wrapper class. (:issue:`4613`)
215+
- Remove undocumented/unused ``kind`` keyword argument from ``read_excel``, and ``ExcelFile``. (:issue:`4713`, :issue:`4712`)
215216

216217
**Experimental Features**
217218

pandas/io/excel.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
from pandas import json
1414
from pandas.compat import map, zip, reduce, range, lrange
1515
import pandas.compat as compat
16+
from warnings import warn
1617

1718

18-
def read_excel(path_or_buf, sheetname, kind=None, **kwds):
19+
def read_excel(path_or_buf, sheetname, **kwds):
1920
"""Read an Excel table into a pandas DataFrame
2021
2122
Parameters
@@ -50,8 +51,11 @@ def read_excel(path_or_buf, sheetname, kind=None, **kwds):
5051
parsed : DataFrame
5152
DataFrame from the passed in Excel file
5253
"""
53-
return ExcelFile(path_or_buf, kind=kind).parse(sheetname=sheetname,
54-
kind=kind, **kwds)
54+
if 'kind' in kwds:
55+
kwds.pop('kind')
56+
warn("kind keyword is no longer supported in read_excel and may be "
57+
"removed in a future version", FutureWarning)
58+
return ExcelFile(path_or_buf).parse(sheetname=sheetname, **kwds)
5559

5660

5761
class ExcelFile(object):
@@ -64,8 +68,7 @@ class ExcelFile(object):
6468
path : string or file-like object
6569
Path to xls or xlsx file
6670
"""
67-
def __init__(self, path_or_buf, kind=None, **kwds):
68-
self.kind = kind
71+
def __init__(self, path_or_buf, **kwds):
6972

7073
import xlrd # throw an ImportError if we need to
7174

pandas/io/parsers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1979,6 +1979,6 @@ def __init__(self, path):
19791979
super(ExcelWriter, self).__init__(path)
19801980

19811981
class ExcelFile(excel.ExcelFile):
1982-
def __init__(self, path_or_buf, kind=None, **kwds):
1982+
def __init__(self, path_or_buf, **kwds):
19831983
warn("ExcelFile can now be imported from: pandas.io.excel", FutureWarning)
1984-
super(ExcelFile, self).__init__(path_or_buf, kind=kind, **kwds)
1984+
super(ExcelFile, self).__init__(path_or_buf, **kwds)

0 commit comments

Comments
 (0)