Skip to content

Commit a7ff39c

Browse files
committed
format error messages
1 parent 3ac4895 commit a7ff39c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pandas/formats/style.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,13 @@ def _apply(self, func, axis=0, subset=None, **kwargs):
433433
else:
434434
result = func(data, **kwargs)
435435
if not isinstance(result, pd.DataFrame):
436-
raise TypeError("Function {!r} must return a DataFrame when "
437-
"passed to `Styler.apply` with axis=None")
436+
raise TypeError(
437+
"Function {!r} must return a DataFrame when "
438+
"passed to `Styler.apply` with axis=None".format(func))
438439
if not (result.index.equals(data.index) and
439440
result.columns.equals(data.columns)):
440441
msg = ('Result of {!r} must have identical index and columns '
441-
'as the input')
442+
'as the input'.format(func))
442443
raise ValueError(msg)
443444

444445
result_shape = result.shape

0 commit comments

Comments
 (0)