Skip to content

Commit 2972bfa

Browse files
committed
fix DataFrame.transform doc issues
1 parent c26034a commit 2972bfa

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/source/user_guide/basics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ Passing a dict of functions will allow selective transforming per column.
11301130

11311131
.. ipython:: python
11321132
1133-
tsdf.transform({"A": np.abs, "B": lambda x: x + 1})
1133+
tsdf.transform({"A": np.abs, "B": lambda x: x + 1}, series_ops_only=True)
11341134
11351135
Passing a dict of lists will generate a MultiIndexed DataFrame with these
11361136
selective transforms.

pandas/core/apply.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def transform(self) -> DataFrame | Series:
235235
if not by_row:
236236
result = obj.apply(func, by_row=by_row, args=args, **kwargs)
237237
else:
238+
print(func, isinstance(func, np.ufunc))
238239
# func is either str or callable
239240
func = cast(AggFuncTypeBase, func)
240241
try:

0 commit comments

Comments
 (0)