diff --git a/pandas/core/dtypes/astype.py b/pandas/core/dtypes/astype.py index 75464cbb2b5f9..94b92ead92374 100644 --- a/pandas/core/dtypes/astype.py +++ b/pandas/core/dtypes/astype.py @@ -144,7 +144,9 @@ def _astype_float_to_int_nansafe( """ if not np.isfinite(values).all(): raise IntCastingNaNError( - "Cannot convert non-finite values (NA or inf) to integer" + "Cannot convert non-finite values (NA or inf) to integer." + "Replace or remove non-finite values or cast to an integer type" + "that supports these values (e.g. 'Int64')" ) if dtype.kind == "u": # GH#45151