Skip to content

Commit

Permalink
DOC: Fix EX03 flake8 errors in docstrings (pandas-dev#56834)
Browse files Browse the repository at this point in the history
* Fix formatting in `pandas.Series.cat.set_categories` and `pandas.Series.plot.bar`

* Remove unused code in code_checks.sh

---------

Co-authored-by: Marc Garcia <garcia.marc@gmail.com>
  • Loading branch information
luke396 and datapythonista committed Jan 12, 2024
1 parent f4f006c commit 612823e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Partially validate docstrings (EX03)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX03 --ignore_functions \
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 \
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pandas/plotting/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 612823e

Please sign in to comment.