diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 7dd347327f3cc..0f331f969a718 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -63,9 +63,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then MSG='Partially validate docstrings (EX01)' ; echo $MSG $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX01 --ignore_functions \ - pandas.Series.backfill \ - pandas.Series.pad \ - pandas.Series.hist \ pandas.errors.AccessorRegistrationWarning \ pandas.errors.AttributeConflictWarning \ pandas.errors.DataError \ @@ -138,8 +135,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.api.extensions.ExtensionArray.ndim \ pandas.api.extensions.ExtensionArray.shape \ pandas.api.extensions.ExtensionArray.tolist \ - pandas.DataFrame.pad \ - pandas.DataFrame.plot \ pandas.DataFrame.to_gbq \ pandas.DataFrame.__dataframe__ RET=$(($RET + $?)) ; echo $MSG "DONE" diff --git a/pandas/core/generic.py b/pandas/core/generic.py index bbc6e7a56febf..f5a9557b9be98 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -7385,6 +7385,10 @@ def pad( ------- {klass} or None Object with missing values filled or None if ``inplace=True``. + + Examples + -------- + Please see examples for :meth:`DataFrame.ffill` or :meth:`Series.ffill`. """ warnings.warn( "DataFrame.pad/Series.pad is deprecated. Use " @@ -7521,7 +7525,7 @@ def backfill( Examples -------- - Please see examples for :meth:`DataFrame.bfill`. + Please see examples for :meth:`DataFrame.bfill` or :meth:`Series.bfill`. """ warnings.warn( "DataFrame.backfill/Series.backfill is deprecated. Use " diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 97492c4d5843e..07c77ec4f3e0a 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -103,6 +103,16 @@ def hist_series( Examples -------- + For Series: + + .. plot:: + :context: close-figs + + >>> lst = ['a', 'a', 'a', 'b', 'b', 'b'] + >>> ser = pd.Series([1, 2, 2, 4, 6, 6], index=lst) + >>> hist = ser.hist() + + For Groupby: .. plot:: :context: close-figs @@ -790,7 +800,7 @@ class PlotAccessor(PandasObject): Examples -------- - For SeriesGroupBy: + For Series: .. plot:: :context: close-figs @@ -798,7 +808,7 @@ class PlotAccessor(PandasObject): >>> ser = pd.Series([1, 2, 3, 3]) >>> plot = ser.plot(kind='hist', title="My plot") - For DataFrameGroupBy: + For DataFrame: .. plot:: :context: close-figs @@ -806,7 +816,25 @@ class PlotAccessor(PandasObject): >>> df = pd.DataFrame({'length': [1.5, 0.5, 1.2, 0.9, 3], ... 'width': [0.7, 0.2, 0.15, 0.2, 1.1]}, ... index=['pig', 'rabbit', 'duck', 'chicken', 'horse']) - >>> plot = df.plot() + >>> plot = df.plot(title="DataFrame Plot") + + For SeriesGroupBy: + + .. plot:: + :context: close-figs + + >>> lst = [-1, -2, -3, 1, 2, 3] + >>> ser = pd.Series([1, 2, 2, 4, 6, 6], index=lst) + >>> plot = ser.groupby(lambda x: x > 0).plot(title="SeriesGroupBy Plot") + + For DataFrameGroupBy: + + .. plot:: + :context: close-figs + + >>> df = pd.DataFrame({"col1" : [1, 2, 3, 4], + ... "col2" : ["A", "B", "A", "B"]}) + >>> plot = df.groupby("col2").plot(kind="bar", title="DataFrameGroupBy Plot") """ _common_kinds = ("line", "bar", "barh", "kde", "density", "area", "hist", "box")