From 7d57434a5a8ea707b12bc6ddbea1ab1cdbba59b9 Mon Sep 17 00:00:00 2001 From: William Wai Lim Chan Date: Sun, 25 Jul 2021 16:35:17 -0400 Subject: [PATCH 1/3] skipped doc test --- pandas/io/formats/style.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 91a301b665f7c..58dc9d780d181 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -536,7 +536,7 @@ def to_latex( >>> df = pd.DataFrame([[1,2], [3,4]]) >>> s = df.style.highlight_max(axis=None, ... props='background-color:red; font-weight:bold;') - >>> s.render() + >>> s.render() # doctest: +SKIP The equivalent using LaTeX only commands is the following: From 033e8bc9a3e1842c4d4b29c751f23983b3b3b59d Mon Sep 17 00:00:00 2001 From: William Wai Lim Chan Date: Sun, 15 Aug 2021 14:35:29 -0400 Subject: [PATCH 2/3] fixed groupby.transform docs --- pandas/core/groupby/groupby.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index aad43e4f96b81..c6bb085955a00 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -318,14 +318,13 @@ class providing the base-class of operations. """ _transform_template = """ -Call function producing a like-indexed %(klass)s on each group and -return a %(klass)s having the same indexes as the original object -filled with the transformed values +Apply function ``func`` column-by-column to the GroupBy object and return a %(klass)s with the same length as the group. Parameters ---------- -f : function +func : function Function to apply to each group. + Function to apply Can also accept a Numba JIT function with ``engine='numba'`` specified. @@ -375,16 +374,16 @@ class providing the base-class of operations. Each group is endowed the attribute 'name' in case you need to know which group you are working on. -The current implementation imposes three requirements on f: +The current implementation imposes three requirements on func: -* f must return a value that either has the same shape as the input +* func must return a value that either has the same shape as the input subframe or can be broadcast to the shape of the input subframe. - For example, if `f` returns a scalar it will be broadcast to have the + For example, if `func` returns a scalar it will be broadcast to have the same shape as the input subframe. -* if this is a DataFrame, f must support application column-by-column - in the subframe. If f also supports application to the entire subframe, +* func must support application column-by-column + in the subframe. If func also supports application to the entire subframe, then a fast path is used starting from the second chunk. -* f must not mutate groups. Mutation is not supported and may +* func must not mutate groups. Mutation is not supported and may produce unexpected results. See :ref:`gotchas.udf-mutation` for more details. When using ``engine='numba'``, there will be no "fall back" behavior internally. From 227fc0db6a48d0c6c5c5361b491631d14452b6e3 Mon Sep 17 00:00:00 2001 From: William Wai Lim Chan Date: Sun, 15 Aug 2021 14:51:54 -0400 Subject: [PATCH 3/3] fixed linting issues --- pandas/core/groupby/groupby.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index c6bb085955a00..211698aae5e1d 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -318,13 +318,13 @@ class providing the base-class of operations. """ _transform_template = """ -Apply function ``func`` column-by-column to the GroupBy object and return a %(klass)s with the same length as the group. +Apply function ``func`` column-by-column to the GroupBy object and return a %(klass)s with +the same length as the group. Parameters ---------- func : function - Function to apply to each group. - Function to apply + Function to apply to each column within each group. Can also accept a Numba JIT function with ``engine='numba'`` specified.