Skip to content

Commit b0d19e1

Browse files
wany-ohyehoshuadimarsky
authored andcommitted
DOC: avoid overriding Python built-in functions (pandas-dev#47631)
avoid overriding Python built-in functions
1 parent f19c23d commit b0d19e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/source/user_guide/groupby.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,10 @@ Alternatively, the built-in methods could be used to produce the same outputs.
839839

840840
.. ipython:: python
841841
842-
max = ts.groupby(lambda x: x.year).transform("max")
843-
min = ts.groupby(lambda x: x.year).transform("min")
842+
max_ts = ts.groupby(lambda x: x.year).transform("max")
843+
min_ts = ts.groupby(lambda x: x.year).transform("min")
844844
845-
max - min
845+
max_ts - min_ts
846846
847847
Another common data transform is to replace missing data with the group mean.
848848

0 commit comments

Comments
 (0)