Skip to content

DOC: Change "Convention for examples" to use Series name as ser instead of s #53304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions doc/source/development/contributing_docstring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down