Skip to content

DOC: Fixing PR09 formatting errors #30622

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 14 commits into from
Jan 3, 2020
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 @@ -528,17 +529,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
12 changes: 7 additions & 5 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,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 @@ -2148,9 +2149,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 @@ -7877,7 +7879,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 @@ -7915,7 +7917,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 @@ -2099,17 +2099,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 @@ -79,18 +79,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 @@ -101,7 +100,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 @@ -526,8 +526,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 @@ -541,7 +543,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