Skip to content

DOC: Docstring EX03 fixes for pandas.DataFrame methods #56898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.io.formats.style.Styler.highlight_quantile \
pandas.io.formats.style.Styler.background_gradient \
pandas.io.formats.style.Styler.text_gradient \
pandas.DataFrame.values \
pandas.DataFrame.groupby \
pandas.DataFrame.sort_values \
pandas.DataFrame.plot.hexbin \
pandas.DataFrame.plot.line \
RET=$(($RET + $?)) ; echo $MSG "DONE"
Expand Down
20 changes: 10 additions & 10 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -7087,8 +7087,8 @@ def sort_values(
using the `natsort <https://github.com/SethMMorton/natsort>` package.

>>> df = pd.DataFrame({
... "time": ['0hr', '128hr', '72hr', '48hr', '96hr'],
... "value": [10, 20, 30, 40, 50]
... "time": ['0hr', '128hr', '72hr', '48hr', '96hr'],
... "value": [10, 20, 30, 40, 50]
... })
>>> df
time value
Expand Down Expand Up @@ -9035,8 +9035,8 @@ def update(
We can also choose to include NA in group keys or not by setting
`dropna` parameter, the default setting is `True`.

>>> l = [[1, 2, 3], [1, None, 4], [2, 1, 3], [1, 2, 2]]
>>> df = pd.DataFrame(l, columns=["a", "b", "c"])
>>> arr = [[1, 2, 3], [1, None, 4], [2, 1, 3], [1, 2, 2]]
>>> df = pd.DataFrame(arr, columns=["a", "b", "c"])

>>> df.groupby(by=["b"]).sum()
a c
Expand All @@ -9051,8 +9051,8 @@ def update(
2.0 2 5
NaN 1 4

>>> l = [["a", 12, 12], [None, 12.3, 33.], ["b", 12.3, 123], ["a", 1, 1]]
>>> df = pd.DataFrame(l, columns=["a", "b", "c"])
>>> arr = [["a", 12, 12], [None, 12.3, 33.], ["b", 12.3, 123], ["a", 1, 1]]
>>> df = pd.DataFrame(arr, columns=["a", "b", "c"])

>>> df.groupby(by="a").sum()
b c
Expand Down Expand Up @@ -12569,7 +12569,7 @@ def values(self) -> np.ndarray:
A DataFrame where all columns are the same type (e.g., int64) results
in an array of the same type.

>>> df = pd.DataFrame({'age': [ 3, 29],
>>> df = pd.DataFrame({'age': [3, 29],
... 'height': [94, 170],
... 'weight': [31, 115]})
>>> df
Expand All @@ -12589,10 +12589,10 @@ def values(self) -> np.ndarray:
results in an ndarray of the broadest type that accommodates these
mixed types (e.g., object).

>>> df2 = pd.DataFrame([('parrot', 24.0, 'second'),
... ('lion', 80.5, 1),
>>> df2 = pd.DataFrame([('parrot', 24.0, 'second'),
... ('lion', 80.5, 1),
... ('monkey', np.nan, None)],
... columns=('name', 'max_speed', 'rank'))
... columns=('name', 'max_speed', 'rank'))
>>> df2.dtypes
name object
max_speed float64
Expand Down