From 8caad08f80dbbb2d2a70033deaf828872993ae7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Sun, 16 Aug 2020 23:23:40 -0400 Subject: [PATCH 1/2] REGR: re-add encoding for read_excel --- doc/source/whatsnew/v1.1.1.rst | 1 + pandas/io/excel/_base.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc/source/whatsnew/v1.1.1.rst b/doc/source/whatsnew/v1.1.1.rst index 565b4a014bd0c..2d6ea674ccdc0 100644 --- a/doc/source/whatsnew/v1.1.1.rst +++ b/doc/source/whatsnew/v1.1.1.rst @@ -27,6 +27,7 @@ Fixed regressions - Fixed regression where :meth:`DataFrame.merge_asof` would raise a ``UnboundLocalError`` when ``left_index`` , ``right_index`` and ``tolerance`` were set (:issue:`35558`) - Fixed regression in ``.groupby(..).rolling(..)`` where a custom ``BaseIndexer`` would be ignored (:issue:`35557`) - Fixed regression in :meth:`~pandas.core.groupby.DataFrameGroupBy.agg` where a list of functions would produce the wrong results if at least one of the functions did not aggregate. (:issue:`35490`) +- Fixed regression in :func:`pandas.read_execl` where ``encoding`` was removed but is necessary for some files (:issue:`35753`) .. --------------------------------------------------------------------------- diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index b1bbda4a4b7e0..aee705976f3d1 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -199,6 +199,8 @@ Duplicate columns will be specified as 'X', 'X.1', ...'X.N', rather than 'X'...'X'. Passing in False will cause data to be overwritten if there are duplicate names in the columns. +encoding : str, default "utf-8" + The encoding to use to decode bytes. Returns ------- @@ -298,6 +300,7 @@ def read_excel( skipfooter=0, convert_float=True, mangle_dupe_cols=True, + encoding: str = "utf-8", ): if not isinstance(io, ExcelFile): @@ -332,6 +335,7 @@ def read_excel( skipfooter=skipfooter, convert_float=convert_float, mangle_dupe_cols=mangle_dupe_cols, + encoding=encoding, ) From 6d89156571284395d7e78f378e12c448cb6b1010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Mon, 17 Aug 2020 17:19:21 -0400 Subject: [PATCH 2/2] Update doc/source/whatsnew/v1.1.1.rst Co-authored-by: Simon Hawkins --- doc/source/whatsnew/v1.1.1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.1.1.rst b/doc/source/whatsnew/v1.1.1.rst index 2d6ea674ccdc0..4b25b1c1bf51a 100644 --- a/doc/source/whatsnew/v1.1.1.rst +++ b/doc/source/whatsnew/v1.1.1.rst @@ -27,7 +27,7 @@ Fixed regressions - Fixed regression where :meth:`DataFrame.merge_asof` would raise a ``UnboundLocalError`` when ``left_index`` , ``right_index`` and ``tolerance`` were set (:issue:`35558`) - Fixed regression in ``.groupby(..).rolling(..)`` where a custom ``BaseIndexer`` would be ignored (:issue:`35557`) - Fixed regression in :meth:`~pandas.core.groupby.DataFrameGroupBy.agg` where a list of functions would produce the wrong results if at least one of the functions did not aggregate. (:issue:`35490`) -- Fixed regression in :func:`pandas.read_execl` where ``encoding`` was removed but is necessary for some files (:issue:`35753`) +- Fixed regression in :func:`pandas.read_excel` where ``encoding`` was removed but is necessary for some files (:issue:`35753`) .. ---------------------------------------------------------------------------