From 190faac7f1fa1accf4ec0ffa566ae1fd88b9692c Mon Sep 17 00:00:00 2001 From: Rakshit Naidu Date: Tue, 4 Feb 2020 08:12:21 +0530 Subject: [PATCH 1/9] Update generic.py --- pandas/core/generic.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 3bb584d4d34e8..e4c2d7c1c0895 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10315,10 +10315,6 @@ def _doc_parms(cls): level : int or level name, default None If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a %(name1)s. -numeric_only : bool, default None - Include only float, int, boolean columns. If None, will attempt to use - everything, then use only numeric data. Not implemented for Series. -%(min_count)s\ **kwargs Additional keyword arguments to be passed to the function. From 8b53292196438a0902c2c89f3744a1cbc68a69f5 Mon Sep 17 00:00:00 2001 From: Rakshit Naidu Date: Tue, 4 Feb 2020 16:02:33 +0530 Subject: [PATCH 2/9] Updated generic.py --- pandas/core/generic.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index e4c2d7c1c0895..8f0ce355f0c70 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9960,7 +9960,7 @@ def _add_numeric_operations(cls): see_also="", examples="", ) - @Appender(_num_doc) + @Appender(_num_doc_mad) def mad(self, axis=None, skipna=None, level=None): if skipna is None: skipna = True @@ -10306,6 +10306,32 @@ def _doc_parms(cls): _num_doc = """ %(desc)s +Parameters +---------- +axis : %(axis_descr)s + Axis for the function to be applied on. +skipna : bool, default True + Exclude NA/null values when computing the result. +level : int or level name, default None + If the axis is a MultiIndex (hierarchical), count along a + particular level, collapsing into a %(name1)s. +numeric_only : bool, default None + Include only float, int, boolean columns. If None, will attempt to use + everything, then use only numeric data. Not implemented for Series. +%(min_count)s\ +**kwargs + Additional keyword arguments to be passed to the function. + +Returns +------- +%(name1)s or %(name2)s (if level specified)\ +%(see_also)s\ +%(examples)s +""" + +_num_doc_mad = """ +%(desc)s + Parameters ---------- axis : %(axis_descr)s From 4227ba45bbd71f92c3913466572a8ee9bc8f3781 Mon Sep 17 00:00:00 2001 From: Rakshit Naidu Date: Tue, 4 Feb 2020 16:21:04 +0530 Subject: [PATCH 3/9] Updated generic.py --- pandas/core/generic.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 8f0ce355f0c70..b809bc1a1c496 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10336,13 +10336,11 @@ def _doc_parms(cls): ---------- axis : %(axis_descr)s Axis for the function to be applied on. -skipna : bool, default True +skipna : bool, default None Exclude NA/null values when computing the result. level : int or level name, default None If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a %(name1)s. -**kwargs - Additional keyword arguments to be passed to the function. Returns ------- From cd7a8817db99c63e7ce3a2a758793ca07c27e171 Mon Sep 17 00:00:00 2001 From: Rakshit Naidu Date: Wed, 5 Feb 2020 17:05:57 +0530 Subject: [PATCH 4/9] Removed notes from df.applymap --- pandas/core/frame.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 83a2a509c0743..2e3275b4b88f7 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6969,13 +6969,6 @@ def applymap(self, func) -> "DataFrame": -------- DataFrame.apply : Apply a function along input axis of DataFrame. - Notes - ----- - In the current implementation applymap calls `func` twice on the - first column/row to decide whether it can take a fast or slow - code path. This can lead to unexpected behavior if `func` has - side-effects, as they will take effect twice for the first - column/row. Examples -------- @@ -6990,8 +6983,7 @@ def applymap(self, func) -> "DataFrame": 0 3 4 1 5 5 - Note that a vectorized version of `func` often exists, which will - be much faster. You could square each number elementwise. + You could square each number elementwise. >>> df.applymap(lambda x: x**2) 0 1 From 4a4426090d74a6a51ad36d1f2de5e076f4193e56 Mon Sep 17 00:00:00 2001 From: Rakshit Naidu Date: Wed, 5 Feb 2020 21:29:55 +0530 Subject: [PATCH 5/9] Updated frame.py --- doc/make.spec | 33 +++++++++++++++++++++++++++++++++ doc/myScript.spec | 33 +++++++++++++++++++++++++++++++++ pandas/core/frame.py | 1 - 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 doc/make.spec create mode 100644 doc/myScript.spec diff --git a/doc/make.spec b/doc/make.spec new file mode 100644 index 0000000000000..946a75dcfdab8 --- /dev/null +++ b/doc/make.spec @@ -0,0 +1,33 @@ +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + + +a = Analysis(['make.py'], + pathex=['/home/rakshit/Desktop/python_practice/pandas/doc'], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='make', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True ) diff --git a/doc/myScript.spec b/doc/myScript.spec new file mode 100644 index 0000000000000..7318f5b55cf8c --- /dev/null +++ b/doc/myScript.spec @@ -0,0 +1,33 @@ +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + + +a = Analysis(['myScript.py'], + pathex=['/home/rakshit/Desktop/python_practice/pandas/doc'], + binaries=[], + datas=[], + hiddenimports=['pandas._libs.tslibs.timedeltas'], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='myScript', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True ) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 2e3275b4b88f7..efd0959179d88 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6997,7 +6997,6 @@ def applymap(self, func) -> "DataFrame": 0 1.000000 4.494400 1 11.262736 20.857489 """ - # if we have a dtype == 'M8[ns]', provide boxed values def infer(x): if x.empty: From f95e6c5e2256872d9e6beb2b1d48d381604a26b6 Mon Sep 17 00:00:00 2001 From: Rakshit Naidu Date: Wed, 5 Feb 2020 21:51:34 +0530 Subject: [PATCH 6/9] Updated frame.py --- pandas/core/frame.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index efd0959179d88..9ec98fc053642 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6969,7 +6969,6 @@ def applymap(self, func) -> "DataFrame": -------- DataFrame.apply : Apply a function along input axis of DataFrame. - Examples -------- >>> df = pd.DataFrame([[1, 2.12], [3.356, 4.567]]) From 0ec76ed9aca8cae2b33a2a685c7ec02bf38e45a0 Mon Sep 17 00:00:00 2001 From: Rakshit Naidu Date: Thu, 6 Feb 2020 00:45:53 +0530 Subject: [PATCH 7/9] Updated frame.py --- pandas/core/frame.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 9ec98fc053642..22fa3108c37f5 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6982,6 +6982,9 @@ def applymap(self, func) -> "DataFrame": 0 3 4 1 5 5 + Note that a vectorized version of `func` often exists, which will + be much faster. You could square each number elementwise. + You could square each number elementwise. >>> df.applymap(lambda x: x**2) From eb4b4db035e5f8a4df10d55fed7b505e783ba3ba Mon Sep 17 00:00:00 2001 From: Rakshit Naidu Date: Thu, 6 Feb 2020 00:57:28 +0530 Subject: [PATCH 8/9] Updated --- doc/make.spec | 33 --------------------------------- doc/myScript.spec | 33 --------------------------------- 2 files changed, 66 deletions(-) delete mode 100644 doc/make.spec delete mode 100644 doc/myScript.spec diff --git a/doc/make.spec b/doc/make.spec deleted file mode 100644 index 946a75dcfdab8..0000000000000 --- a/doc/make.spec +++ /dev/null @@ -1,33 +0,0 @@ -# -*- mode: python ; coding: utf-8 -*- - -block_cipher = None - - -a = Analysis(['make.py'], - pathex=['/home/rakshit/Desktop/python_practice/pandas/doc'], - binaries=[], - datas=[], - hiddenimports=[], - hookspath=[], - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False) -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) -exe = EXE(pyz, - a.scripts, - a.binaries, - a.zipfiles, - a.datas, - [], - name='make', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - upx_exclude=[], - runtime_tmpdir=None, - console=True ) diff --git a/doc/myScript.spec b/doc/myScript.spec deleted file mode 100644 index 7318f5b55cf8c..0000000000000 --- a/doc/myScript.spec +++ /dev/null @@ -1,33 +0,0 @@ -# -*- mode: python ; coding: utf-8 -*- - -block_cipher = None - - -a = Analysis(['myScript.py'], - pathex=['/home/rakshit/Desktop/python_practice/pandas/doc'], - binaries=[], - datas=[], - hiddenimports=['pandas._libs.tslibs.timedeltas'], - hookspath=[], - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False) -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) -exe = EXE(pyz, - a.scripts, - a.binaries, - a.zipfiles, - a.datas, - [], - name='myScript', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - upx_exclude=[], - runtime_tmpdir=None, - console=True ) From a6ea38946013c5b2ef374e3f98ad68376478d625 Mon Sep 17 00:00:00 2001 From: Rakshit Naidu Date: Thu, 6 Feb 2020 00:59:43 +0530 Subject: [PATCH 9/9] Updated --- pandas/core/frame.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 22fa3108c37f5..9fe3c6aa48ca2 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6982,9 +6982,8 @@ def applymap(self, func) -> "DataFrame": 0 3 4 1 5 5 - Note that a vectorized version of `func` often exists, which will - be much faster. You could square each number elementwise. - + Note that a vectorized version of `func` often exists, + which will be much faster. You could square each number elementwise. >>> df.applymap(lambda x: x**2)