From 5582e740db465f6770ad2e0ba95f63b6bd301026 Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Sun, 18 Nov 2018 20:02:27 +0530 Subject: [PATCH 1/3] fix a spelling --- pandas/api/extensions/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/api/extensions/__init__.py b/pandas/api/extensions/__init__.py index 51555c57b2288..cb6241016d82f 100644 --- a/pandas/api/extensions/__init__.py +++ b/pandas/api/extensions/__init__.py @@ -1,4 +1,4 @@ -"""Public API for extending panadas objects.""" +"""Public API for extending pandas objects.""" from pandas.core.accessor import (register_dataframe_accessor, # noqa register_index_accessor, register_series_accessor) From 4199285f314c511ea47f2983f5b2181052f40a11 Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Sun, 18 Nov 2018 22:14:13 +0530 Subject: [PATCH 2/3] Improve docstring of make_signature function and remove unnecessary enumerate function. --- pandas/util/_decorators.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pandas/util/_decorators.py b/pandas/util/_decorators.py index 638282f322c74..75cc68c62ae18 100644 --- a/pandas/util/_decorators.py +++ b/pandas/util/_decorators.py @@ -314,14 +314,15 @@ def indent(text, indents=1): def make_signature(func): """ - Returns a string repr of the arg list of a func call, with any defaults. + Returns a string repr of tuple - the arg list of a func call with + any defaults and the arg list. Examples -------- >>> def f(a,b,c=2) : >>> return a*b*c - >>> print(_make_signature(f)) - a,b,c=2 + >>> print(make_signature(f)) + (['a', 'b', 'c=2'], ['a', 'b', 'c']) """ spec = signature(func) @@ -332,7 +333,7 @@ def make_signature(func): n_wo_defaults = len(spec.args) - len(spec.defaults) defaults = ('',) * n_wo_defaults + tuple(spec.defaults) args = [] - for i, (var, default) in enumerate(zip(spec.args, defaults)): + for var, default in zip(spec.args, defaults): args.append(var if default == '' else var + '=' + repr(default)) if spec.varargs: args.append('*' + spec.varargs) From bb8640fe1105d8b52f88ea990e6d7dc7a5cfb711 Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Mon, 19 Nov 2018 08:45:26 +0530 Subject: [PATCH 3/3] Fix docstring --- pandas/util/_decorators.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/util/_decorators.py b/pandas/util/_decorators.py index 75cc68c62ae18..818c7a51becdf 100644 --- a/pandas/util/_decorators.py +++ b/pandas/util/_decorators.py @@ -314,13 +314,13 @@ def indent(text, indents=1): def make_signature(func): """ - Returns a string repr of tuple - the arg list of a func call with - any defaults and the arg list. + Returns a tuple containing the paramenter list with defaults + and parameter list. Examples -------- - >>> def f(a,b,c=2) : - >>> return a*b*c + >>> def f(a, b, c=2): + >>> return a * b * c >>> print(make_signature(f)) (['a', 'b', 'c=2'], ['a', 'b', 'c']) """