Skip to content

Commit d7a6d4e

Browse files
committed
ENH: Improve IntCastingNaNError message with solutions
1 parent b5bd33b commit d7a6d4e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/dtypes/astype.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ def _astype_float_to_int_nansafe(
144144
"""
145145
if not np.isfinite(values).all():
146146
raise IntCastingNaNError(
147-
"""Cannot convert non-finite values (NA or inf) to integer.
148-
Replace or remove non-finite values or cast to an integer type
149-
that supports these values (e.g. 'Int64')"""
147+
"Cannot convert non-finite values (NA or inf) to integer."
148+
"Replace or remove non-finite values or cast to an integer type"
149+
"that supports these values (e.g. 'Int64')"
150150
)
151151
if dtype.kind == "u":
152152
# GH#45151

0 commit comments

Comments
 (0)