From 522ced694889713ffe3c0668a52afb580ace54d8 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang <77875500+luke396@users.noreply.github.com> Date: Thu, 11 Jan 2024 19:15:36 +0800 Subject: [PATCH 1/2] Fix formatting in `pandas.Series.cat.set_categories` and `pandas.Series.plot.bar` --- pandas/core/arrays/categorical.py | 2 +- pandas/plotting/_core.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 342aaad3f9adc..5a88aed1419e3 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -1082,7 +1082,7 @@ def set_categories( For :class:`pandas.Series`: >>> raw_cat = pd.Categorical(['a', 'b', 'c', 'A'], - ... categories=['a', 'b', 'c'], ordered=True) + ... categories=['a', 'b', 'c'], ordered=True) >>> ser = pd.Series(raw_cat) >>> ser 0 a diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index cb5598a98d5af..96609fdc1671b 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -1114,7 +1114,7 @@ def line( .. plot:: :context: close-figs - >>> df = pd.DataFrame({'lab':['A', 'B', 'C'], 'val':[10, 30, 20]}) + >>> df = pd.DataFrame({'lab': ['A', 'B', 'C'], 'val': [10, 30, 20]}) >>> ax = df.plot.bar(x='lab', y='val', rot=0) Plot a whole dataframe to a bar plot. Each column is assigned a @@ -1195,7 +1195,7 @@ def bar( # pylint: disable=disallowed-name """ See Also -------- - DataFrame.plot.bar: Vertical bar plot. + DataFrame.plot.bar : Vertical bar plot. DataFrame.plot : Make plots of DataFrame using matplotlib. matplotlib.axes.Axes.bar : Plot a vertical bar plot using matplotlib. From bbc776d407b460dd7d9771179ffa3bfb3b2a7d89 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang <77875500+luke396@users.noreply.github.com> Date: Thu, 11 Jan 2024 23:40:15 +0800 Subject: [PATCH 2/2] Remove unused code in code_checks.sh --- ci/code_checks.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 38dccff6e2bdc..6bb76197f66a7 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -73,9 +73,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX03 --ignore_functions \ pandas.Series.dt.day_name \ pandas.Series.str.len \ - pandas.Series.cat.set_categories \ - pandas.Series.plot.bar \ - pandas.Series.plot.hist \ pandas.Series.plot.line \ pandas.Series.to_sql \ pandas.Series.to_latex \