From 537b06332f8ed9338b79941d92f9e96509ca5372 Mon Sep 17 00:00:00 2001 From: austinburnett Date: Fri, 19 May 2023 18:01:38 -0400 Subject: [PATCH 1/4] Change naming scheme of series from s to ser --- .../development/contributing_docstring.rst | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/source/development/contributing_docstring.rst b/doc/source/development/contributing_docstring.rst index 6524e4da2299d..2f35969faa56f 100644 --- a/doc/source/development/contributing_docstring.rst +++ b/doc/source/development/contributing_docstring.rst @@ -695,10 +695,10 @@ and avoiding aliases. Avoid excessive imports, but if needed, imports from the standard library go first, followed by third-party libraries (like matplotlib). -When illustrating examples with a single ``Series`` use the name ``s``, and if +When illustrating examples with a single ``Series`` use the name ``ser``, and if illustrating with a single ``DataFrame`` use the name ``df``. For indices, ``idx`` is the preferred name. If a set of homogeneous ``Series`` or -``DataFrame`` is used, name them ``s1``, ``s2``, ``s3``... or ``df1``, +``DataFrame`` is used, name them ``ser1``, ``ser2``, ``ser3``... or ``df1``, ``df2``, ``df3``... If the data is not homogeneous, and more than one structure is needed, name them with something meaningful, for example ``df_main`` and ``df_to_join``. @@ -731,8 +731,8 @@ positional arguments ``head(3)``. Examples -------- - >>> s = pd.Series([1, 2, 3]) - >>> s.mean() + >>> ser = pd.Series([1, 2, 3]) + >>> ser.mean() 2 """ pass @@ -744,8 +744,8 @@ positional arguments ``head(3)``. Examples -------- - >>> s = pd.Series([1, np.nan, 3]) - >>> s.fillna(0) + >>> ser = pd.Series([1, np.nan, 3]) + >>> ser.fillna(0) [1, 0, 3] """ pass @@ -756,10 +756,10 @@ positional arguments ``head(3)``. Examples -------- - >>> s = pd.Series([380., 370., 24., 26], + >>> ser = pd.Series([380., 370., 24., 26], ... name='max_speed', ... index=['falcon', 'falcon', 'parrot', 'parrot']) - >>> s.groupby_mean() + >>> ser.groupby_mean() index falcon 375.0 parrot 25.0 @@ -776,8 +776,8 @@ positional arguments ``head(3)``. Examples -------- - >>> s = pd.Series('Antelope', 'Lion', 'Zebra', np.nan) - >>> s.contains(pattern='a') + >>> ser = pd.Series('Antelope', 'Lion', 'Zebra', np.nan) + >>> ser.contains(pattern='a') 0 False 1 False 2 True @@ -800,7 +800,7 @@ positional arguments ``head(3)``. We can fill missing values in the output using the ``na`` parameter: - >>> s.contains(pattern='a', na=False) + >>> ser.contains(pattern='a', na=False) 0 False 1 False 2 True From e4ad71ade5df6fef8c8e3df402c875c007dc4e49 Mon Sep 17 00:00:00 2001 From: austinburnett Date: Fri, 19 May 2023 18:04:53 -0400 Subject: [PATCH 2/4] Change naming scheme of series from s to ser --- doc/source/development/contributing_docstring.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/development/contributing_docstring.rst b/doc/source/development/contributing_docstring.rst index 2f35969faa56f..079e74b0b7e83 100644 --- a/doc/source/development/contributing_docstring.rst +++ b/doc/source/development/contributing_docstring.rst @@ -573,8 +573,8 @@ For example: See Also -------- - Series.tail : Return the last 5 elements of the Series. - Series.iloc : Return a slice of the elements in the Series, + ser.tail : Return the last 5 elements of the Series. + ser.iloc : Return a slice of the elements in the Series, which can also be used to return the first or last n. """ return self.iloc[:5] @@ -920,8 +920,8 @@ plot will be generated automatically when building the documentation. .. plot:: :context: close-figs - >>> s = pd.Series([1, 2, 3]) - >>> s.plot() + >>> ser = pd.Series([1, 2, 3]) + >>> ser.plot() """ pass From c2e8e240f6f857d151576149536f9127de313159 Mon Sep 17 00:00:00 2001 From: austinburnett Date: Fri, 19 May 2023 18:17:08 -0400 Subject: [PATCH 3/4] Change naming scheme of series from s to ser --- doc/source/development/contributing_docstring.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/development/contributing_docstring.rst b/doc/source/development/contributing_docstring.rst index 079e74b0b7e83..c6582f31cc82f 100644 --- a/doc/source/development/contributing_docstring.rst +++ b/doc/source/development/contributing_docstring.rst @@ -573,8 +573,8 @@ For example: See Also -------- - ser.tail : Return the last 5 elements of the Series. - ser.iloc : Return a slice of the elements in the Series, + Series.tail : Return the last 5 elements of the Series. + Series.iloc : Return a slice of the elements in the Series, which can also be used to return the first or last n. """ return self.iloc[:5] @@ -652,7 +652,7 @@ A simple example could be: Examples -------- - >>> s = pd.Series(['Ant', 'Bear', 'Cow', 'Dog', 'Falcon', + >>> ser = pd.Series(['Ant', 'Bear', 'Cow', 'Dog', 'Falcon', ... 'Lion', 'Monkey', 'Rabbit', 'Zebra']) >>> s.head() 0 Ant @@ -664,7 +664,7 @@ A simple example could be: With the ``n`` parameter, we can change the number of returned rows: - >>> s.head(n=3) + >>> ser.head(n=3) 0 Ant 1 Bear 2 Cow From b8c5efd45e017c013996021653dd984d9d910eda Mon Sep 17 00:00:00 2001 From: austinburnett Date: Fri, 19 May 2023 18:18:49 -0400 Subject: [PATCH 4/4] Change naming scheme of series from s to ser --- doc/source/development/contributing_docstring.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/development/contributing_docstring.rst b/doc/source/development/contributing_docstring.rst index c6582f31cc82f..87aecb6936c9c 100644 --- a/doc/source/development/contributing_docstring.rst +++ b/doc/source/development/contributing_docstring.rst @@ -654,7 +654,7 @@ A simple example could be: -------- >>> ser = pd.Series(['Ant', 'Bear', 'Cow', 'Dog', 'Falcon', ... 'Lion', 'Monkey', 'Rabbit', 'Zebra']) - >>> s.head() + >>> ser.head() 0 Ant 1 Bear 2 Cow