Skip to content

DOC: Fixes to docstrings, mainly PR09 errors #29530

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

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
fb76a17
PR09 in pandas.DataFrame.idxmax
HughKelley Nov 10, 2019
0f40afb
PR09 in pandas.DataFrame.idxmin
HughKelley Nov 10, 2019
94ac074
PR09 in pandas.DataFrame.sort_values
HughKelley Nov 10, 2019
e8a5ab1
PR09 in pandas.DataFrame.to_html
HughKelley Nov 10, 2019
90cc836
PR09 in pandas.arrays.DatetimeArray
HughKelley Nov 10, 2019
9e6d290
PR09 in pandas.Categorical
HughKelley Nov 10, 2019
64b7c75
PR09 in pandas.Grouper
HughKelley Nov 10, 2019
d84b2a1
PR09 in pandas.ExcelWriter
HughKelley Nov 10, 2019
214add3
PR09 in pandas.core.window.ewm.EWM.cov
HughKelley Nov 10, 2019
705f441
PR09 in pandas.core.groupby.GroupBy.rank
HughKelley Nov 10, 2019
b3f1074
PR09 in pandas.PeriodIndex
HughKelley Nov 10, 2019
9d7f405
PR09 in pandas.PeriodIndex.asfreq
HughKelley Nov 10, 2019
cb524fd
PR09 in pandas.PeriodIndex.to_timestamp
HughKelley Nov 10, 2019
9a517aa
whitespace
HughKelley Nov 10, 2019
b99d417
PR09 in pandas.DataFrame.corr
HughKelley Nov 10, 2019
8095d30
PR09 in pandas.read_excel
HughKelley Nov 10, 2019
e8c4c50
Add PR09 to CI checks
HughKelley Nov 12, 2019
a86a34b
merge master
HughKelley Nov 15, 2019
76daea6
fix spacing
HughKelley Nov 15, 2019
e6094eb
fix indentation of deprecation warning
HughKelley Nov 15, 2019
04bc5a4
indentation in DataFrame.corr
HughKelley Nov 15, 2019
2e427e9
indentation in pandas.read_excel
HughKelley Nov 15, 2019
735e6c2
indentation in read_excel
HughKelley Nov 15, 2019
0292b1e
merge master
HughKelley Nov 15, 2019
2f3b875
PR09 in pandas.DataFrame.idxmax
HughKelley Nov 10, 2019
405da2b
PR09 in pandas.DataFrame.idxmin
HughKelley Nov 10, 2019
4f718eb
PR09 in pandas.DataFrame.sort_values
HughKelley Nov 10, 2019
84ab4da
PR09 in pandas.DataFrame.to_html
HughKelley Nov 10, 2019
60d9a1f
PR09 in pandas.arrays.DatetimeArray
HughKelley Nov 10, 2019
7d1bcdd
PR09 in pandas.Categorical
HughKelley Nov 10, 2019
9585d6e
PR09 in pandas.Grouper
HughKelley Nov 10, 2019
9d5ed04
PR09 in pandas.ExcelWriter
HughKelley Nov 10, 2019
a049e8d
PR09 in pandas.core.window.ewm.EWM.cov
HughKelley Nov 10, 2019
af1d4d9
PR09 in pandas.core.groupby.GroupBy.rank
HughKelley Nov 10, 2019
abe0eb8
PR09 in pandas.PeriodIndex
HughKelley Nov 10, 2019
44755f1
PR09 in pandas.PeriodIndex.asfreq
HughKelley Nov 10, 2019
796828f
PR09 in pandas.PeriodIndex.to_timestamp
HughKelley Nov 10, 2019
6e703aa
whitespace
HughKelley Nov 10, 2019
4525b08
PR09 in pandas.DataFrame.corr
HughKelley Nov 10, 2019
1fd931a
PR09 in pandas.read_excel
HughKelley Nov 10, 2019
a5eb1a9
Add PR09 to CI checks
HughKelley Nov 12, 2019
3ff70b4
fix spacing
HughKelley Nov 15, 2019
080a77b
fix indentation of deprecation warning
HughKelley Nov 15, 2019
de22262
indentation in DataFrame.corr
HughKelley Nov 15, 2019
c56b0f9
indentation in pandas.read_excel
HughKelley Nov 15, 2019
18f492e
indentation in read_excel
HughKelley Nov 15, 2019
0826a6f
Merge branch 'PR09_batch_5' of github.com:HughKelley/pandas into PR09…
HughKelley Nov 18, 2019
25167fb
Merge branch 'master' of https://github.com/pandas-dev/pandas into PR…
HughKelley Nov 20, 2019
c4848eb
merge master
HughKelley Nov 27, 2019
0f9c6d1
merge master resolve conflict
HughKelley Dec 11, 2019
2f72294
merge master
HughKelley Dec 11, 2019
d434831
PR09 errors
HughKelley Dec 11, 2019
fdc670e
merge master
HughKelley Dec 31, 2019
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
2 changes: 1 addition & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ fi
### DOCSTRINGS ###
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA01, SA02, SA03, SA05)' ; echo $MSG
MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS04, SS05, PR03, PR04, PR05, PR09, PR10, EX04, RT01, RT04, RT05, SA01, SA02, SA03, SA05)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA01,SA02,SA03,SA05
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should add the error you fixed here too, the previous is only a message for the log

RET=$(($RET + $?)) ; echo $MSG "DONE"

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 @@ -232,7 +232,7 @@ class Categorical(ExtensionArray, PandasObject):
`categories` attribute (which in turn is the `categories` argument, if
provided).
dtype : CategoricalDtype
An instance of ``CategoricalDtype`` to use for this categorical
An instance of ``CategoricalDtype`` to use for this categorical.

.. versionadded:: 0.21.0

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,12 @@ class DatetimeArray(dtl.DatetimeLikeArrayMixin, dtl.TimelikeOps, dtl.DatelikeOps
The datetime data.

For DatetimeArray `values` (or a Series or Index boxing one),
`dtype` and `freq` will be extracted from `values`, with
precedence given to
`dtype` and `freq` will be extracted from `values`.

dtype : numpy.dtype or DatetimeTZDtype
Note that the only NumPy dtype allowed is 'datetime64[ns]'.
freq : str or Offset, optional
The frequency.
copy : bool, default False
Whether to copy the underlying array of values.

Expand Down
18 changes: 11 additions & 7 deletions pandas/core/arrays/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,9 @@ def to_timestamp(self, freq=None, how="start"):
----------
freq : str or DateOffset, optional
Target frequency. The default is 'D' for week or longer,
'S' otherwise
'S' otherwise.
how : {'s', 'e', 'start', 'end'}
Whether to use the start or end of the time period being converted.

Returns
-------
Expand Down Expand Up @@ -530,17 +531,20 @@ def asfreq(self, freq=None, how="E"):
Parameters
----------
freq : str
a frequency
A frequency.
how : str {'E', 'S'}
'E', 'END', or 'FINISH' for end,
'S', 'START', or 'BEGIN' for start.
Whether the elements should be aligned to the end
or start within pa period. January 31st ('END') vs.
January 1st ('START') for example.
or start within pa period.

* 'E', 'END', or 'FINISH' for end,
* 'S', 'START', or 'BEGIN' for start.

January 31st ('END') vs. January 1st ('START') for example.

Returns
-------
new : Period Array/Index with the new frequency
Period Array/Index
Constructed with the new frequency.

Examples
--------
Expand Down
20 changes: 11 additions & 9 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,12 @@
Name or list of names to sort by.

- if `axis` is 0 or `'index'` then `by` may contain index
levels and/or column labels
levels and/or column labels.
- if `axis` is 1 or `'columns'` then `by` may contain column
levels and/or index labels
levels and/or index labels.

.. versionchanged:: 0.23.0

Allow specifying index or column level names.""",
versionadded_to_excel="",
optional_labels="""labels : array-like, optional
Expand Down Expand Up @@ -2112,9 +2113,10 @@ def to_html(
A ``border=border`` attribute is included in the opening
`<table>` tag. Default ``pd.options.display.html.border``.
encoding : str, default "utf-8"
Set character encoding
Set character encoding.

.. versionadded:: 1.0

table_id : str, optional
A css id is included in the opening `<table>` tag if specified.

Expand Down Expand Up @@ -7146,11 +7148,11 @@ def corr(self, method="pearson", min_periods=1):
* kendall : Kendall Tau correlation coefficient
* spearman : Spearman rank correlation
* callable: callable with input two 1d ndarrays
and returning a float. Note that the returned matrix from corr
will have 1 along the diagonals and will be symmetric
regardless of the callable's behavior.
and returning a float. Note that the returned matrix from corr
will have 1 along the diagonals and will be symmetric
regardless of the callable's behavior.

.. versionadded:: 0.24.0
.. versionadded:: 0.24.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you check if the html version of this docstring looks good? those indentations are always tricky

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct (it has the same indentation as the list item)


min_periods : int, optional
Minimum number of observations required per pair of columns
Expand Down Expand Up @@ -7716,7 +7718,7 @@ def idxmin(self, axis=0, skipna=True):
Parameters
----------
axis : {0 or 'index', 1 or 'columns'}, default 0
The axis to use. 0 or 'index' for row-wise, 1 or 'columns' for column-wise
The axis to use. 0 or 'index' for row-wise, 1 or 'columns' for column-wise.
skipna : bool, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA.
Expand Down Expand Up @@ -7754,7 +7756,7 @@ def idxmax(self, axis=0, skipna=True):
Parameters
----------
axis : {0 or 'index', 1 or 'columns'}, default 0
The axis to use. 0 or 'index' for row-wise, 1 or 'columns' for column-wise
The axis to use. 0 or 'index' for row-wise, 1 or 'columns' for column-wise.
skipna : bool, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA.
Expand Down
16 changes: 8 additions & 8 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -2098,17 +2098,17 @@ def rank(
Parameters
----------
method : {'average', 'min', 'max', 'first', 'dense'}, default 'average'
* average: average rank of group
* min: lowest rank in group
* max: highest rank in group
* first: ranks assigned in order they appear in the array
* dense: like 'min', but rank always increases by 1 between groups
* average: average rank of group.
* min: lowest rank in group.
* max: highest rank in group.
* first: ranks assigned in order they appear in the array.
* dense: like 'min', but rank always increases by 1 between groups.
ascending : bool, default True
False for ranks by high (1) to low (N).
na_option : {'keep', 'top', 'bottom'}, default 'keep'
* keep: leave NA values where they are
* top: smallest rank if ascending
* bottom: smallest rank if descending
* keep: leave NA values where they are.
* top: smallest rank if ascending.
* bottom: smallest rank if descending.
pct : bool, default False
Compute percentage rank of data within each group.
axis : int, default 0
Expand Down
12 changes: 6 additions & 6 deletions pandas/core/groupby/grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@

class Grouper:
"""
A Grouper allows the user to specify a groupby instruction for a target
object.
A Grouper allows the user to specify a groupby instruction for an object.

This specification will select a column via the key parameter, or if the
level and/or axis parameters are given, a level of the index of the target
Expand All @@ -47,17 +46,18 @@ class Grouper:
Parameters
----------
key : str, defaults to None
groupby key, which selects the grouping column of the target
Groupby key, which selects the grouping column of the target.
level : name/number, defaults to None
the level for the target index
The level for the target index.
freq : str / frequency object, defaults to None
This will groupby the specified frequency if the target selection
(via key or level) is a datetime-like object. For full specification
of available frequencies, please see `here
<http://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases>`_.
axis : number/name of the axis, defaults to 0
axis : str, int, defaults to 0
Number/name of the axis.
sort : bool, default to False
whether to sort the resulting labels
Whether to sort the resulting labels.
closed : {'left' or 'right'}
Closed end of interval. Only when `freq` parameter is passed.
label : {'left' or 'right'}
Expand Down
9 changes: 4 additions & 5 deletions pandas/core/indexes/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,17 @@ class PeriodDelegateMixin(DatetimelikeDelegateMixin):
)
class PeriodIndex(DatetimeIndexOpsMixin, Int64Index, PeriodDelegateMixin):
"""
Immutable ndarray holding ordinal values indicating regular periods in
time such as particular years, quarters, months, etc.
Immutable ndarray holding ordinal values indicating regular periods in time.

Index keys are boxed to Period objects which carries the metadata (eg,
frequency information).

Parameters
----------
data : array-like (1d int np.ndarray or PeriodArray), optional
Optional period-like data to construct index with
Optional period-like data to construct index with.
copy : bool
Make a copy of input ndarray
Make a copy of input ndarray.
freq : str or period object, optional
One of pandas period strings or corresponding objects
year : int, array, or Series, default None
Expand All @@ -99,7 +98,7 @@ class PeriodIndex(DatetimeIndexOpsMixin, Int64Index, PeriodDelegateMixin):
minute : int, array, or Series, default None
second : int, array, or Series, default None
tz : object, default None
Timezone for converting datetime64 data to Periods
Timezone for converting datetime64 data to Periods.
dtype : str or PeriodDtype, default None

Attributes
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/window/ewm.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def cov(self, other=None, pairwise=None, bias=False, **kwargs):
inputs. In the case of missing elements, only complete pairwise
observations will be used.
bias : bool, default False
Use a standard estimation bias correction
Use a standard estimation bias correction.
**kwargs
Keyword arguments to be passed into func.
"""
Expand Down
8 changes: 5 additions & 3 deletions pandas/io/excel/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,10 @@ def parse(

class ExcelWriter(metaclass=abc.ABCMeta):
"""
Class for writing DataFrame objects into excel sheets, default is to use
xlwt for xls, openpyxl for xlsx. See DataFrame.to_excel for typical usage.
Class for writing DataFrame objects into excel sheets.

Default is to use xlwt for xls, openpyxl for xlsx.
See DataFrame.to_excel for typical usage.

Parameters
----------
Expand All @@ -543,7 +545,7 @@ class ExcelWriter(metaclass=abc.ABCMeta):
Format string for dates written into Excel files (e.g. 'YYYY-MM-DD').
datetime_format : str, default None
Format string for datetime objects written into Excel files.
(e.g. 'YYYY-MM-DD HH:MM:SS')
(e.g. 'YYYY-MM-DD HH:MM:SS').
mode : {'w', 'a'}, default 'w'
File mode to use (write or append).

Expand Down