Skip to content

Commit cbb26c8

Browse files
committed
DOC: Fix broken formatting on docstring examples with first-line comments
1 parent ea1c501 commit cbb26c8

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

pandas/core/generic.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,15 +2722,16 @@ def interpolate(self, method='linear', axis=0, limit=None, inplace=False,
27222722
27232723
Examples
27242724
--------
2725+
.. code-block:: python
27252726
2726-
# Filling in NaNs:
2727-
>>> s = pd.Series([0, 1, np.nan, 3])
2728-
>>> s.interpolate()
2729-
0 0
2730-
1 1
2731-
2 2
2732-
3 3
2733-
dtype: float64
2727+
# Filling in NaNs:
2728+
>>> s = pd.Series([0, 1, np.nan, 3])
2729+
>>> s.interpolate()
2730+
0 0
2731+
1 1
2732+
2 2
2733+
3 3
2734+
dtype: float64
27342735
27352736
"""
27362737
if self.ndim > 2:
@@ -2902,14 +2903,16 @@ def groupby(self, by=None, axis=0, level=None, as_index=True, sort=True,
29022903
29032904
Examples
29042905
--------
2905-
# DataFrame result
2906-
>>> data.groupby(func, axis=0).mean()
2906+
.. code-block:: python
29072907
2908-
# DataFrame result
2909-
>>> data.groupby(['col1', 'col2'])['col3'].mean()
2908+
# DataFrame result
2909+
>>> data.groupby(func, axis=0).mean()
29102910
2911-
# DataFrame with hierarchical index
2912-
>>> data.groupby(['col1', 'col2']).mean()
2911+
# DataFrame result
2912+
>>> data.groupby(['col1', 'col2'])['col3'].mean()
2913+
2914+
# DataFrame with hierarchical index
2915+
>>> data.groupby(['col1', 'col2']).mean()
29132916
29142917
Returns
29152918
-------

0 commit comments

Comments
 (0)