From 7275ccd4a48b116f6c3d69f2791a79fee9ddf105 Mon Sep 17 00:00:00 2001 From: Dipta Laksmana Date: Sat, 29 Feb 2020 04:52:20 +0000 Subject: [PATCH 1/9] Fix PR06 and PR01 in pandas.core.groupby.GroupBy.pipe --- 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 48c00140461b5..da6741da9a0e6 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -212,14 +212,14 @@ class providing the base-class of operations. Parameters ---------- -func : callable or tuple of (callable, string) +func : callable or tuple of (callable, str) Function to apply to this %(klass)s object or, alternatively, a `(callable, data_keyword)` tuple where `data_keyword` is a string indicating the keyword of `callable` that expects the %(klass)s object. -args : iterable, optional +*args : iterable, optional Positional arguments passed into `func`. -kwargs : dict, optional +**kwargs : dict, optional A dictionary of keyword arguments passed into `func`. Returns From 34241fad588a8711a05379f76149def858320f7d Mon Sep 17 00:00:00 2001 From: Dipta Laksmana Date: Sat, 29 Feb 2020 05:00:06 +0000 Subject: [PATCH 2/9] Fix PR06 and PR01 in pandas.core.groupby.GroupBy.pipe --- pandas/core/groupby/groupby.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index da6741da9a0e6..f13085101d60e 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -195,9 +195,9 @@ class providing the base-class of operations. %(versionadded)s -Use `.pipe` when you want to improve readability by chaining together -functions that expect Series, DataFrames, GroupBy or Resampler objects. -Instead of writing +Use `.pipe` when you want to improve readability. +You can do it by chaining together functions. +Where the functions expect Series, DataFrames, GroupBy or Resampler objects instead of writing. >>> h(g(f(df.groupby('group')), arg1=a), arg2=b, arg3=c) @@ -213,18 +213,19 @@ class providing the base-class of operations. Parameters ---------- func : callable or tuple of (callable, str) - Function to apply to this %(klass)s object or, alternatively, + Function to apply to this %(klass)s object or, alternatiy chvely, a `(callable, data_keyword)` tuple where `data_keyword` is a string indicating the keyword of `callable` that expects the %(klass)s object. *args : iterable, optional - Positional arguments passed into `func`. + Positional arguments passed into `func`. **kwargs : dict, optional - A dictionary of keyword arguments passed into `func`. + A dictionary of keyword arguments passed into `func`. Returns ------- -object : the return type of `func`. +object + the return type of `func`. See Also -------- From a514ae6574db827af76dbedbd35b1dfed675ed95 Mon Sep 17 00:00:00 2001 From: Dipta Laksmana Date: Sat, 29 Feb 2020 05:05:42 +0000 Subject: [PATCH 3/9] Fix PR06 and PR01 in pandas.core.groupby.GroupBy.pipe --- pandas/core/groupby/groupby.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index f13085101d60e..ae5ae48e0bcef 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -190,14 +190,14 @@ class providing the base-class of operations. ) _pipe_template = """ -Apply a function `func` with arguments to this %(klass)s object and return -the function's result. +Apply a function `func` with arguments to this %(klass)s object and return the result. %(versionadded)s Use `.pipe` when you want to improve readability. You can do it by chaining together functions. -Where the functions expect Series, DataFrames, GroupBy or Resampler objects instead of writing. +Where the functions expect Series, DataFrames, GroupBy or Resampler objects. +Instead of writing. >>> h(g(f(df.groupby('group')), arg1=a), arg2=b, arg3=c) @@ -225,7 +225,7 @@ class providing the base-class of operations. Returns ------- object - the return type of `func`. + The return type of `func`. See Also -------- From 066c234745f830a9f9923b50d74951f6b39374da Mon Sep 17 00:00:00 2001 From: Dipta Laksmana Date: Sat, 29 Feb 2020 05:23:29 +0000 Subject: [PATCH 4/9] Fix docstring in pandas.core.groupby.GroupBy.pip --- pandas/core/groupby/groupby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index ae5ae48e0bcef..7555305aff80f 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -213,7 +213,7 @@ class providing the base-class of operations. Parameters ---------- func : callable or tuple of (callable, str) - Function to apply to this %(klass)s object or, alternatiy chvely, + Function to apply to this %(klass)s object or, alternatiy, a `(callable, data_keyword)` tuple where `data_keyword` is a string indicating the keyword of `callable` that expects the %(klass)s object. From fe229f4e3c1908471181e7f68bef256a3ffc0688 Mon Sep 17 00:00:00 2001 From: Dipta Laksmana Date: Sat, 7 Mar 2020 21:15:32 +0000 Subject: [PATCH 5/9] Change in pandas.core.groupby.GroupBy.pipe --- Dockerfile | 2 +- pandas/core/groupby/groupby.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b8aff5d671dcf..fea71b4757248 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM continuumio/miniconda3 # if you forked pandas, you can pass in your own GitHub username to use your fork # i.e. gh_username=myname -ARG gh_username=pandas-dev +ARG gh_username=hsjsjsj009 ARG pandas_home="/home/pandas" # Avoid warnings by switching to noninteractive diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 7555305aff80f..ad6e236244830 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -194,9 +194,8 @@ class providing the base-class of operations. %(versionadded)s -Use `.pipe` when you want to improve readability. -You can do it by chaining together functions. -Where the functions expect Series, DataFrames, GroupBy or Resampler objects. +Use `.pipe` when you want to improve readability by chaining together +functions expect Series, DataFrames, GroupBy or Resampler objects. Instead of writing. >>> h(g(f(df.groupby('group')), arg1=a), arg2=b, arg3=c) @@ -213,7 +212,7 @@ class providing the base-class of operations. Parameters ---------- func : callable or tuple of (callable, str) - Function to apply to this %(klass)s object or, alternatiy, + Function to apply to this %(klass)s object or a `(callable, data_keyword)` tuple where `data_keyword` is a string indicating the keyword of `callable` that expects the %(klass)s object. From 93db9e1db084b9d8b55ba9fd5ebed447da7ca1f4 Mon Sep 17 00:00:00 2001 From: Dipta Laksmana Date: Sat, 7 Mar 2020 21:18:16 +0000 Subject: [PATCH 6/9] Change in pandas.core.groupby.GroupBy.pipe --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fea71b4757248..b8aff5d671dcf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM continuumio/miniconda3 # if you forked pandas, you can pass in your own GitHub username to use your fork # i.e. gh_username=myname -ARG gh_username=hsjsjsj009 +ARG gh_username=pandas-dev ARG pandas_home="/home/pandas" # Avoid warnings by switching to noninteractive From b5961667109b08e15ef54430fb57c8d109c7d6eb Mon Sep 17 00:00:00 2001 From: Dipta Laksmana Date: Sat, 7 Mar 2020 21:20:43 +0000 Subject: [PATCH 7/9] Change in pandas.core.groupby.GroupBy.pipe --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fea71b4757248..b8aff5d671dcf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM continuumio/miniconda3 # if you forked pandas, you can pass in your own GitHub username to use your fork # i.e. gh_username=myname -ARG gh_username=hsjsjsj009 +ARG gh_username=pandas-dev ARG pandas_home="/home/pandas" # Avoid warnings by switching to noninteractive From ce93bc4147d17bc970af38a810a229a588d59aed Mon Sep 17 00:00:00 2001 From: Dipta Laksmana Date: Sat, 7 Mar 2020 21:45:06 +0000 Subject: [PATCH 8/9] Restore some doc in pandas.core.groupby.GroupBy --- pandas/core/groupby/groupby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index ad6e236244830..7a46fb7d76630 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -195,7 +195,7 @@ class providing the base-class of operations. %(versionadded)s Use `.pipe` when you want to improve readability by chaining together -functions expect Series, DataFrames, GroupBy or Resampler objects. +functions that expect Series, DataFrames, GroupBy or Resampler objects. Instead of writing. >>> h(g(f(df.groupby('group')), arg1=a), arg2=b, arg3=c) From 31efbfff1b5cf735364746cfe94db1f8bc2d8503 Mon Sep 17 00:00:00 2001 From: Dipta Laksmana Date: Thu, 12 Mar 2020 11:05:18 +0000 Subject: [PATCH 9/9] Fix pandas.core.groupby.GroupBy.pipe docstring --- pandas/core/groupby/groupby.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 7a46fb7d76630..b30e5e3569c03 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -194,9 +194,10 @@ class providing the base-class of operations. %(versionadded)s +Instead of writing: Use `.pipe` when you want to improve readability by chaining together functions that expect Series, DataFrames, GroupBy or Resampler objects. -Instead of writing. + >>> h(g(f(df.groupby('group')), arg1=a), arg2=b, arg3=c)