From bd3c4c5dda104da028ee5ff102c1d36100053743 Mon Sep 17 00:00:00 2001 From: Aart Goossens Date: Mon, 12 Jul 2021 14:58:33 +0200 Subject: [PATCH] ENH - Improved error message for interpolating IntegerArrays (#41565) --- pandas/core/missing.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandas/core/missing.py b/pandas/core/missing.py index f144821220e4b..ff75d73dee47c 100644 --- a/pandas/core/missing.py +++ b/pandas/core/missing.py @@ -117,7 +117,10 @@ def clean_fill_method(method, allow_nearest: bool = False): valid_methods.append("nearest") expecting = "pad (ffill), backfill (bfill) or nearest" if method not in valid_methods: - raise ValueError(f"Invalid fill method. Expecting {expecting}. Got {method}") + raise ValueError( + f"Invalid fill method. Expecting {expecting}. Got {method}." + " Are you trying to interpolate an integer column?" + ) return method