Skip to content

Commit 137389b

Browse files
jordan-d-murphypmhatre1
authored andcommitted
DOC: Fix EX03 errors in docstrings to_latex, read_pickle, pipe (pandas-dev#56843)
1 parent 1639d77 commit 137389b

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

ci/code_checks.sh

-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7373
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX03 --ignore_functions \
7474
pandas.Series.plot.line \
7575
pandas.Series.to_sql \
76-
pandas.Series.to_latex \
7776
pandas.errors.DatabaseError \
7877
pandas.errors.IndexingError \
7978
pandas.errors.InvalidColumnName \
@@ -87,16 +86,13 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8786
pandas.Timestamp.ceil \
8887
pandas.Timestamp.floor \
8988
pandas.Timestamp.round \
90-
pandas.read_pickle \
9189
pandas.ExcelWriter \
9290
pandas.read_json \
9391
pandas.io.json.build_table_schema \
94-
pandas.DataFrame.to_latex \
9592
pandas.io.formats.style.Styler.to_latex \
9693
pandas.read_parquet \
9794
pandas.DataFrame.to_sql \
9895
pandas.read_stata \
99-
pandas.core.resample.Resampler.pipe \
10096
pandas.core.resample.Resampler.interpolate \
10197
pandas.plotting.scatter_matrix \
10298
pandas.pivot \

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3544,7 +3544,7 @@ def to_latex(
35443544
>>> print(df.to_latex(index=False,
35453545
... formatters={"name": str.upper},
35463546
... float_format="{:.1f}".format,
3547-
... )) # doctest: +SKIP
3547+
... )) # doctest: +SKIP
35483548
\begin{tabular}{lrr}
35493549
\toprule
35503550
name & age & height \\

pandas/core/groupby/groupby.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -444,14 +444,15 @@ class providing the base-class of operations.
444444
a `(callable, data_keyword)` tuple where `data_keyword` is a
445445
string indicating the keyword of `callable` that expects the
446446
%(klass)s object.
447-
args : iterable, optional
447+
*args : iterable, optional
448448
Positional arguments passed into `func`.
449-
kwargs : dict, optional
449+
**kwargs : dict, optional
450450
A dictionary of keyword arguments passed into `func`.
451451
452452
Returns
453453
-------
454-
the return type of `func`.
454+
%(klass)s
455+
The original object with the function `func` applied.
455456
456457
See Also
457458
--------

pandas/io/formats/style.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ def to_latex(
770770
771771
For example the following code will highlight and bold a cell in HTML-CSS:
772772
773-
>>> df = pd.DataFrame([[1,2], [3,4]])
773+
>>> df = pd.DataFrame([[1, 2], [3, 4]])
774774
>>> s = df.style.highlight_max(axis=None,
775775
... props='background-color:red; font-weight:bold;')
776776
>>> s.to_html() # doctest: +SKIP
@@ -893,9 +893,9 @@ def to_latex(
893893
>>> s.table_styles = []
894894
>>> s.caption = None
895895
>>> s.format({
896-
... ("Numeric", "Integers"): '\${}',
897-
... ("Numeric", "Floats"): '{:.3f}',
898-
... ("Non-Numeric", "Strings"): str.upper
896+
... ("Numeric", "Integers"): '\\${}',
897+
... ("Numeric", "Floats"): '{:.3f}',
898+
... ("Non-Numeric", "Strings"): str.upper
899899
... }) # doctest: +SKIP
900900
Numeric Non-Numeric
901901
Integers Floats Strings

pandas/io/pickle.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def read_pickle(
121121
storage_options: StorageOptions | None = None,
122122
) -> DataFrame | Series:
123123
"""
124-
Load pickled pandas object (or any object) from file.
124+
Load pickled pandas object (or any object) from file and return unpickled object.
125125
126126
.. warning::
127127
@@ -143,7 +143,8 @@ def read_pickle(
143143
144144
Returns
145145
-------
146-
same type as object stored in file
146+
object
147+
The unpickled pandas object (or any object) that was stored in file.
147148
148149
See Also
149150
--------
@@ -162,7 +163,7 @@ def read_pickle(
162163
--------
163164
>>> original_df = pd.DataFrame(
164165
... {{"foo": range(5), "bar": range(5, 10)}}
165-
... ) # doctest: +SKIP
166+
... ) # doctest: +SKIP
166167
>>> original_df # doctest: +SKIP
167168
foo bar
168169
0 0 5

0 commit comments

Comments
 (0)