From 8860de7679f5df96e87756a42d96ef0432f08fc4 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sun, 10 Sep 2017 15:52:43 +0900 Subject: [PATCH 1/2] resolve issue #14350 --- pandas/_libs/tslib.pyx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandas/_libs/tslib.pyx b/pandas/_libs/tslib.pyx index e4c065202a6ef..63fc84c9d7972 100644 --- a/pandas/_libs/tslib.pyx +++ b/pandas/_libs/tslib.pyx @@ -1445,10 +1445,8 @@ cpdef array_with_unit_to_datetime(ndarray values, unit, errors='coerce'): else: if is_raise: - raise ValueError("non convertible value {0}" - "with the unit '{1}'".format( - val, - unit)) + raise ValueError("unit='{0}' not valid with non-numerical " + "val='{1}'".format(unit, val)) if is_ignore: raise AssertionError From 9777771e38e802c1458312c93ffa47c1341e9ddb Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Mon, 20 Nov 2017 12:57:56 +0900 Subject: [PATCH 2/2] add whatsnew entry --- doc/source/whatsnew/v0.22.0.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/whatsnew/v0.22.0.txt b/doc/source/whatsnew/v0.22.0.txt index 6dc730cae37f7..73ec9e0d5391a 100644 --- a/doc/source/whatsnew/v0.22.0.txt +++ b/doc/source/whatsnew/v0.22.0.txt @@ -26,6 +26,7 @@ Other Enhancements - :func:`pandas.tseries.frequencies.to_offset` now accepts leading '+' signs e.g. '+1h'. (:issue:`18171`) - :class:`pandas.io.formats.style.Styler` now has method ``hide_index()`` to determine whether the index will be rendered in ouptut (:issue:`14194`) - :class:`pandas.io.formats.style.Styler` now has method ``hide_columns()`` to determine whether columns will be hidden in output (:issue:`14194`) +- Improved wording of ValueError raised in :func:`Timestamp.tz_localize` function .. _whatsnew_0220.api_breaking: