From ccee9ebb720aba5c950f9a278ecee7f9f807be2a Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Wed, 15 Feb 2023 12:22:52 +0100 Subject: [PATCH] DOC: fix EX02 errors in docstrings VI --- ci/code_checks.sh | 3 --- pandas/_config/config.py | 1 + pandas/core/groupby/generic.py | 16 ++++++++-------- pandas/core/reshape/merge.py | 1 + 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 567ae6da92ae2..764bb12cc4378 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -597,14 +597,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.api.types.is_timedelta64_ns_dtype \ pandas.api.types.is_unsigned_integer_dtype \ pandas.core.groupby.DataFrameGroupBy.take \ - pandas.core.groupby.SeriesGroupBy.take \ pandas.io.formats.style.Styler.concat \ pandas.io.formats.style.Styler.export \ pandas.io.formats.style.Styler.set_td_classes \ pandas.io.formats.style.Styler.use \ pandas.io.json.build_table_schema \ - pandas.merge_ordered \ - pandas.option_context \ pandas.plotting.andrews_curves \ pandas.plotting.autocorrelation_plot \ pandas.plotting.lag_plot \ diff --git a/pandas/_config/config.py b/pandas/_config/config.py index 4170bb7706bdd..30fd19dfb3177 100644 --- a/pandas/_config/config.py +++ b/pandas/_config/config.py @@ -426,6 +426,7 @@ class option_context(ContextDecorator): Examples -------- + >>> from pandas import option_context >>> with option_context('display.max_rows', 10, 'display.max_columns', 5): ... pass """ diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index 8743f124b033b..4cc0a2b82df04 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -936,7 +936,7 @@ def take( Examples -------- - >>> df = DataFrame([('falcon', 'bird', 389.0), + >>> df = pd.DataFrame([('falcon', 'bird', 389.0), ... ('parrot', 'bird', 24.0), ... ('lion', 'mammal', 80.5), ... ('monkey', 'mammal', np.nan), @@ -2366,7 +2366,7 @@ def take( Examples -------- - >>> df = DataFrame([('falcon', 'bird', 389.0), + >>> df = pd.DataFrame([('falcon', 'bird', 389.0), ... ('parrot', 'bird', 24.0), ... ('lion', 'mammal', 80.5), ... ('monkey', 'mammal', np.nan), @@ -2395,15 +2395,15 @@ def take( 2 2 lion mammal 80.5 1 monkey mammal NaN - The order of the specified indices influnces the order in the result. + The order of the specified indices influences the order in the result. Here, the order is swapped from the previous example. - >>> gb.take([0, 1]) + >>> gb.take([1, 0]) name class max_speed - 1 4 falcon bird 389.0 - 3 parrot bird 24.0 - 2 2 lion mammal 80.5 - 1 monkey mammal NaN + 1 3 parrot bird 24.0 + 4 falcon bird 389.0 + 2 1 monkey mammal NaN + 2 lion mammal 80.5 Take elements at indices 1 and 2 along the axis 1 (column selection). diff --git a/pandas/core/reshape/merge.py b/pandas/core/reshape/merge.py index 37013a5d1fb8f..55d9b5f9366ab 100644 --- a/pandas/core/reshape/merge.py +++ b/pandas/core/reshape/merge.py @@ -277,6 +277,7 @@ def merge_ordered( Examples -------- + >>> from pandas import merge_ordered >>> df1 = pd.DataFrame( ... { ... "key": ["a", "c", "e", "a", "c", "e"],