diff --git a/doc/source/development/contributing_docstring.rst b/doc/source/development/contributing_docstring.rst index 6524e4da2299d..1b8513914f462 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