diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 9e6faa7037dae..28a4d0f4196d7 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6790,7 +6790,8 @@ def nsmallest(self, n: int, columns: IndexLabel, keep: str = "first") -> DataFra 'columns' for column-wise.""" ), examples=dedent( - """Examples + """\ + Examples -------- >>> df = pd.DataFrame( ... {"Grade": ["A", "B", "A", "C"]}, diff --git a/pandas/core/series.py b/pandas/core/series.py index 5e111ccc727fc..65631f539e80d 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -3897,7 +3897,8 @@ def nsmallest(self, n: int = 5, keep: str = "first") -> Series: Whether to copy underlying data.""" ), examples=dedent( - """Examples + """\ + Examples -------- >>> s = pd.Series( ... ["A", "B", "A", "C"],