From 88bd06a7c068367af98f6498e5dfb0d50449e95e Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Thu, 29 Feb 2024 23:34:13 +0530 Subject: [PATCH 01/13] DOC: RT03 fix for min,max,mean,meadian,kurt,skew --- ci/code_checks.sh | 6 ------ pandas/core/generic.py | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 998e48d96d6b3..8931de7a15420 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -627,14 +627,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.DataFrame.get\ pandas.DataFrame.hist\ pandas.DataFrame.infer_objects\ - pandas.DataFrame.kurt\ pandas.DataFrame.kurtosis\ pandas.DataFrame.last_valid_index\ pandas.DataFrame.mask\ - pandas.DataFrame.max\ - pandas.DataFrame.mean\ - pandas.DataFrame.median\ - pandas.DataFrame.min\ pandas.DataFrame.nsmallest\ pandas.DataFrame.nunique\ pandas.DataFrame.pipe\ @@ -648,7 +643,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.DataFrame.reindex\ pandas.DataFrame.reorder_levels\ pandas.DataFrame.sem\ - pandas.DataFrame.skew\ pandas.DataFrame.std\ pandas.DataFrame.sum\ pandas.DataFrame.swapaxes\ diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 1bc6b7a3eea03..207fb89c83bde 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11961,7 +11961,8 @@ def last_valid_index(self) -> Hashable: Returns ------- -{name1} or scalar\ +{name1} or scalar + Either {name1} or scalar based on ``axis`` selected.\ {see_also}\ {examples} """ From 74875ab2afa05a44fb3ae0a162efb76d79589a6f Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Fri, 1 Mar 2024 00:37:26 +0530 Subject: [PATCH 02/13] retrigger checks From 964e8d50bb7635e562b024a145cade7e54077ec2 Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Fri, 1 Mar 2024 14:49:08 +0530 Subject: [PATCH 03/13] Review Suggestions --- pandas/core/generic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 207fb89c83bde..27fdf58403e87 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11962,7 +11962,8 @@ def last_valid_index(self) -> Hashable: Returns ------- {name1} or scalar - Either {name1} or scalar based on ``axis`` selected.\ + The result of applying the {name} to the DataFrame elements, + possibly just for rows or columns based on the axis parameter.\ {see_also}\ {examples} """ From 2e87eceac6f457c1427f4d01e2360e16348ce024 Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Fri, 1 Mar 2024 14:54:13 +0530 Subject: [PATCH 04/13] Review Suggestions Implemented --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 27fdf58403e87..e5030c436ae37 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11962,7 +11962,7 @@ def last_valid_index(self) -> Hashable: Returns ------- {name1} or scalar - The result of applying the {name} to the DataFrame elements, + The result of applying the {name} function to the DataFrame elements, possibly just for rows or columns based on the axis parameter.\ {see_also}\ {examples} From 44835404cb88d22af6d35a06780fe223cfce3e21 Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Sat, 2 Mar 2024 10:15:10 +0530 Subject: [PATCH 05/13] updated return type in doc --- pandas/core/generic.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index e5030c436ae37..ed565ed9c4ff3 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11961,8 +11961,8 @@ def last_valid_index(self) -> Hashable: Returns ------- -{name1} or scalar - The result of applying the {name} function to the DataFrame elements, +{name1} + The result of applying the {name} function to the {name2} elements, possibly just for rows or columns based on the axis parameter.\ {see_also}\ {examples} @@ -13012,6 +13012,10 @@ def make_doc(name: str, ndim: int) -> str: else: raise NotImplementedError + if base_doc is _num_doc: + if name2 == "DataFrame": + name1 = name1 + " or scalar" + docstr = base_doc.format( desc=desc, name=name, From 00295f5e09ddb7b1f7a2f0ea1c0acecbe30059bf Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Sat, 2 Mar 2024 10:18:57 +0530 Subject: [PATCH 06/13] removed series functions from partially ignoring --- ci/code_checks.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 8931de7a15420..2b59ef6115ffc 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -708,14 +708,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Series.first_valid_index\ pandas.Series.get\ pandas.Series.infer_objects\ - pandas.Series.kurt\ pandas.Series.kurtosis\ pandas.Series.last_valid_index\ pandas.Series.mask\ - pandas.Series.max\ - pandas.Series.mean\ - pandas.Series.median\ - pandas.Series.min\ pandas.Series.nunique\ pandas.Series.pipe\ pandas.Series.plot.box\ @@ -727,7 +722,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Series.reindex\ pandas.Series.reorder_levels\ pandas.Series.sem\ - pandas.Series.skew\ pandas.Series.sparse.to_coo\ pandas.Series.std\ pandas.Series.str.capitalize\ From ce00d728565c172228fa3f1bd076f5a221915ea8 Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Sun, 3 Mar 2024 21:14:42 +0530 Subject: [PATCH 07/13] Review suggestions --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index ed565ed9c4ff3..299148bc7bf50 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11963,7 +11963,7 @@ def last_valid_index(self) -> Hashable: ------- {name1} The result of applying the {name} function to the {name2} elements, - possibly just for rows or columns based on the axis parameter.\ + possibly just for rows or columns based on the ``axis`` parameter.\ {see_also}\ {examples} """ From 495fb1b98eb4ca061e2acd57a7aea9e687b79827 Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Sat, 9 Mar 2024 20:20:15 +0530 Subject: [PATCH 08/13] refactored logic --- ci/code_checks.sh | 18 ----------------- pandas/core/generic.py | 45 +++++++++++++++++++++++------------------- 2 files changed, 25 insertions(+), 38 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index c4e43b88a0097..5b659d76c75ad 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -616,21 +616,13 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=RT03 --ignore_functions \ pandas.DataFrame.hist\ pandas.DataFrame.infer_objects\ - pandas.DataFrame.kurt\ pandas.DataFrame.kurtosis\ pandas.DataFrame.mask\ - pandas.DataFrame.max\ - pandas.DataFrame.mean\ - pandas.DataFrame.median\ - pandas.DataFrame.min\ pandas.DataFrame.pop\ pandas.DataFrame.prod\ pandas.DataFrame.product\ pandas.DataFrame.reindex\ pandas.DataFrame.reorder_levels\ - pandas.DataFrame.sem\ - pandas.DataFrame.skew\ - pandas.DataFrame.std\ pandas.DataFrame.sum\ pandas.DataFrame.swapaxes\ pandas.DataFrame.to_numpy\ @@ -638,7 +630,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.DataFrame.to_parquet\ pandas.DataFrame.unstack\ pandas.DataFrame.value_counts\ - pandas.DataFrame.var\ pandas.DataFrame.where\ pandas.DatetimeIndex.indexer_at_time\ pandas.DatetimeIndex.indexer_between_time\ @@ -695,14 +686,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Series.first_valid_index\ pandas.Series.get\ pandas.Series.infer_objects\ - pandas.Series.kurt\ pandas.Series.kurtosis\ pandas.Series.last_valid_index\ pandas.Series.mask\ - pandas.Series.max\ - pandas.Series.mean\ - pandas.Series.median\ - pandas.Series.min\ pandas.Series.nunique\ pandas.Series.pipe\ pandas.Series.plot.box\ @@ -713,10 +699,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Series.product\ pandas.Series.reindex\ pandas.Series.reorder_levels\ - pandas.Series.sem\ - pandas.Series.skew\ pandas.Series.sparse.to_coo\ - pandas.Series.std\ pandas.Series.str.capitalize\ pandas.Series.str.casefold\ pandas.Series.str.center\ @@ -749,7 +732,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Series.to_numpy\ pandas.Series.to_timestamp\ pandas.Series.value_counts\ - pandas.Series.var\ pandas.Series.where\ pandas.TimedeltaIndex.as_unit\ pandas.TimedeltaIndex.to_pytimedelta\ diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 69442a6ca87cf..ac2953096af8f 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11859,7 +11859,7 @@ def last_valid_index(self) -> Hashable: Returns ------- -{name1} +{return_type} The result of applying the {name} function to the {name2} elements, possibly just for rows or columns based on the ``axis`` parameter.\ {see_also}\ @@ -11894,7 +11894,9 @@ def last_valid_index(self) -> Hashable: Returns ------- -{name1} or scalar\ +{return_type} + The result of applying the {name} function to the {name2} elements, + possibly just for rows or columns based on the ``axis`` parameter.\ {see_also}\ {examples} """ @@ -11924,7 +11926,9 @@ def last_valid_index(self) -> Hashable: Returns ------- -{name1} or {name2} (if level specified) \ +{return_type} (if level specified) + The result of applying the {name} function to the {name2} elements, + possibly just for rows or columns based on the ``axis`` parameter.\ {notes}\ {examples} """ @@ -12022,9 +12026,9 @@ def last_valid_index(self) -> Hashable: Returns ------- -{name1} or {name2} - If level is specified, then, {name2} is returned; otherwise, {name1} - is returned. +{return_type} + The result of applying the {name} function to the {name2} elements, + possibly just for rows or columns based on the ``axis`` parameter.\ {see_also} {examples}""" @@ -12109,8 +12113,9 @@ def last_valid_index(self) -> Hashable: Returns ------- -{name1} or {name2} - Return cumulative {desc} of {name1} or {name2}. +{return_type} + The result of applying the cumulative {desc} function to the {name2} elements, + possibly just for rows or columns based on the ``axis`` parameter.\ See Also -------- @@ -12575,14 +12580,6 @@ def make_doc(name: str, ndim: int) -> str: """ Generate the docstring for a Series/DataFrame reduction. """ - if ndim == 1: - name1 = "scalar" - name2 = "Series" - axis_descr = "{index (0)}" - else: - name1 = "Series" - name2 = "DataFrame" - axis_descr = "{index (0), columns (1)}" if name == "any": base_doc = _bool_doc @@ -12910,14 +12907,22 @@ def make_doc(name: str, ndim: int) -> str: else: raise NotImplementedError - if base_doc is _num_doc: - if name2 == "DataFrame": - name1 = name1 + " or scalar" + if ndim == 1: + return_type = "Series or scalar" + axis_descr = "{index (0)}" + name2 = "Series" + else: + if base_doc in (_num_doc, _sum_prod_doc): + return_type = "scalar" + else: + return_type = "Series or scalar" + axis_descr = "{index (0), columns (1)}" + name2 = "DataFrame" docstr = base_doc.format( desc=desc, name=name, - name1=name1, + return_type=return_type, name2=name2, axis_descr=axis_descr, see_also=see_also, From 097eb4a9cf753ab9d2d7546de12264940908b5de Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Sat, 9 Mar 2024 22:30:56 +0530 Subject: [PATCH 09/13] reformatting --- pandas/core/generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index ac2953096af8f..98fe94e08189f 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -12028,7 +12028,7 @@ def last_valid_index(self) -> Hashable: ------- {return_type} The result of applying the {name} function to the {name2} elements, - possibly just for rows or columns based on the ``axis`` parameter.\ + possibly just for rows or columns based on the ``axis`` parameter. {see_also} {examples}""" @@ -12115,7 +12115,7 @@ def last_valid_index(self) -> Hashable: ------- {return_type} The result of applying the cumulative {desc} function to the {name2} elements, - possibly just for rows or columns based on the ``axis`` parameter.\ + possibly just for rows or columns based on the ``axis`` parameter. See Also -------- From 523fc012643d84db56ac1b2e386a0e749bdf3bee Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Tue, 12 Mar 2024 19:41:48 +0530 Subject: [PATCH 10/13] updated if logic --- pandas/core/generic.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 98fe94e08189f..644b6283734c8 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -12911,11 +12911,10 @@ def make_doc(name: str, ndim: int) -> str: return_type = "Series or scalar" axis_descr = "{index (0)}" name2 = "Series" - else: if base_doc in (_num_doc, _sum_prod_doc): return_type = "scalar" - else: - return_type = "Series or scalar" + else: + return_type = "Series or scalar" axis_descr = "{index (0), columns (1)}" name2 = "DataFrame" From eb33a4b66476909eb40f93c7894c9ab8a2d508e8 Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Sun, 17 Mar 2024 22:17:46 +0530 Subject: [PATCH 11/13] review suggestions --- pandas/core/generic.py | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index f99dbb30258c7..d1aa8a04d0f84 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11814,7 +11814,7 @@ def last_valid_index(self) -> Hashable: Returns ------- {return_type} - The result of applying the {name} function to the {name2} elements, + The result of applying the {name} function to the {obj_type} elements, possibly just for rows or columns based on the ``axis`` parameter.\ {see_also}\ {examples} @@ -11849,7 +11849,7 @@ def last_valid_index(self) -> Hashable: Returns ------- {return_type} - The result of applying the {name} function to the {name2} elements, + The result of applying the {name} function to the {obj_type} elements, possibly just for rows or columns based on the ``axis`` parameter.\ {see_also}\ {examples} @@ -11881,7 +11881,7 @@ def last_valid_index(self) -> Hashable: Returns ------- {return_type} (if level specified) - The result of applying the {name} function to the {name2} elements, + The result of applying the {name} function to the {obj_type} elements, possibly just for rows or columns based on the ``axis`` parameter.\ {notes}\ {examples} @@ -11981,7 +11981,7 @@ def last_valid_index(self) -> Hashable: Returns ------- {return_type} - The result of applying the {name} function to the {name2} elements, + The result of applying the {name} function to the {obj_type} elements, possibly just for rows or columns based on the ``axis`` parameter. {see_also} @@ -12068,19 +12068,19 @@ def last_valid_index(self) -> Hashable: Returns ------- {return_type} - The result of applying the cumulative {desc} function to the {name2} elements, + The result of applying the cumulative {desc} function to the {obj_type} elements, possibly just for rows or columns based on the ``axis`` parameter. See Also -------- core.window.expanding.Expanding.{accum_func_name} : Similar functionality but ignores ``NaN`` values. -{name2}.{accum_func_name} : Return the {desc} over - {name2} axis. -{name2}.cummax : Return cumulative maximum over {name2} axis. -{name2}.cummin : Return cumulative minimum over {name2} axis. -{name2}.cumsum : Return cumulative sum over {name2} axis. -{name2}.cumprod : Return cumulative product over {name2} axis. +{obj_type}.{accum_func_name} : Return the {desc} over + {obj_type} axis. +{obj_type}.cummax : Return cumulative maximum over {obj_type} axis. +{obj_type}.cummin : Return cumulative minimum over {obj_type} axis. +{obj_type}.cumsum : Return cumulative sum over {obj_type} axis. +{obj_type}.cumprod : Return cumulative product over {obj_type} axis. {examples}""" @@ -12862,21 +12862,23 @@ def make_doc(name: str, ndim: int) -> str: raise NotImplementedError if ndim == 1: - return_type = "Series or scalar" + return_type = "Scalar or Series" axis_descr = "{index (0)}" - name2 = "Series" + obj_type = "Series" if base_doc in (_num_doc, _sum_prod_doc): - return_type = "scalar" + return_type = "Scalar" else: - return_type = "Series or scalar" + return_type = "Series or DataFrame" axis_descr = "{index (0), columns (1)}" - name2 = "DataFrame" + obj_type = "DataFrame" + if base_doc in (_num_doc, _sum_prod_doc): + return_type = "Series or Scalar" docstr = base_doc.format( desc=desc, name=name, return_type=return_type, - name2=name2, + obj_type=obj_type, axis_descr=axis_descr, see_also=see_also, examples=examples, From b8e10e02300d4f7518bb84dee512c4c7af287f05 Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Thu, 21 Mar 2024 21:46:54 +0530 Subject: [PATCH 12/13] logic update --- pandas/core/generic.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index d1aa8a04d0f84..dde47d79c3edb 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11880,7 +11880,7 @@ def last_valid_index(self) -> Hashable: Returns ------- -{return_type} (if level specified) +{return_type} The result of applying the {name} function to the {obj_type} elements, possibly just for rows or columns based on the ``axis`` parameter.\ {notes}\ @@ -12862,17 +12862,17 @@ def make_doc(name: str, ndim: int) -> str: raise NotImplementedError if ndim == 1: - return_type = "Scalar or Series" + return_type = "Scalar" axis_descr = "{index (0)}" obj_type = "Series" - if base_doc in (_num_doc, _sum_prod_doc): - return_type = "Scalar" + if base_doc in (_cnum_doc): + return_type = "Series or Scalar" else: - return_type = "Series or DataFrame" + return_type = "Series or Scalar" axis_descr = "{index (0), columns (1)}" obj_type = "DataFrame" - if base_doc in (_num_doc, _sum_prod_doc): - return_type = "Series or Scalar" + if base_doc in (_cnum_doc): + return_type = "DataFrame or Series" docstr = base_doc.format( desc=desc, From 8b0feb170c511bebb78a7b0e39716b31aac3e63e Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Thu, 21 Mar 2024 23:53:33 +0530 Subject: [PATCH 13/13] Removed additional RT03 --- ci/code_checks.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 2728f46ce28f0..fdce580b6e171 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -97,7 +97,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.DataFrame.infer_objects RT03" \ -i "pandas.DataFrame.keys SA01" \ -i "pandas.DataFrame.kurt SA01" \ - -i "pandas.DataFrame.kurtosis RT03,SA01" \ + -i "pandas.DataFrame.kurtosis SA01" \ -i "pandas.DataFrame.last_valid_index SA01" \ -i "pandas.DataFrame.mask RT03" \ -i "pandas.DataFrame.mean SA01" \ @@ -105,8 +105,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.DataFrame.pad PR01,SA01" \ -i "pandas.DataFrame.plot PR02,SA01" \ -i "pandas.DataFrame.pop SA01" \ - -i "pandas.DataFrame.prod RT03" \ - -i "pandas.DataFrame.product RT03" \ -i "pandas.DataFrame.reorder_levels SA01" \ -i "pandas.DataFrame.sem PR01,SA01" \ -i "pandas.DataFrame.skew SA01" \ @@ -116,7 +114,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.DataFrame.sparse.to_coo SA01" \ -i "pandas.DataFrame.sparse.to_dense SA01" \ -i "pandas.DataFrame.std PR01,SA01" \ - -i "pandas.DataFrame.sum RT03" \ -i "pandas.DataFrame.swapaxes PR01,SA01" \ -i "pandas.DataFrame.swaplevel SA01" \ -i "pandas.DataFrame.to_feather SA01" \ @@ -391,7 +388,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.item SA01" \ -i "pandas.Series.keys SA01" \ -i "pandas.Series.kurt SA01" \ - -i "pandas.Series.kurtosis RT03,SA01" \ + -i "pandas.Series.kurtosis SA01" \ -i "pandas.Series.last_valid_index SA01" \ -i "pandas.Series.le PR07,SA01" \ -i "pandas.Series.list.__getitem__ SA01" \ @@ -412,8 +409,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.plot PR02,SA01" \ -i "pandas.Series.pop RT03,SA01" \ -i "pandas.Series.pow PR07" \ - -i "pandas.Series.prod RT03" \ - -i "pandas.Series.product RT03" \ -i "pandas.Series.radd PR07" \ -i "pandas.Series.rdiv PR07" \ -i "pandas.Series.reorder_levels RT03,SA01" \ @@ -467,7 +462,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.str.zfill RT03" \ -i "pandas.Series.struct.dtypes SA01" \ -i "pandas.Series.sub PR07" \ - -i "pandas.Series.sum RT03" \ -i "pandas.Series.swaplevel SA01" \ -i "pandas.Series.to_dict SA01" \ -i "pandas.Series.to_frame SA01" \