Skip to content

Commit 9ed3262

Browse files
HughKelleyjreback
authored andcommitted
DOC: Fixing PR09 formatting errors (#30622)
1 parent cda117d commit 9ed3262

File tree

9 files changed

+45
-38
lines changed

9 files changed

+45
-38
lines changed

pandas/core/arrays/categorical.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class Categorical(ExtensionArray, PandasObject):
232232
`categories` attribute (which in turn is the `categories` argument, if
233233
provided).
234234
dtype : CategoricalDtype
235-
An instance of ``CategoricalDtype`` to use for this categorical
235+
An instance of ``CategoricalDtype`` to use for this categorical.
236236
237237
.. versionadded:: 0.21.0
238238

pandas/core/arrays/datetimes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,12 @@ class DatetimeArray(dtl.DatetimeLikeArrayMixin, dtl.TimelikeOps, dtl.DatelikeOps
230230
The datetime data.
231231
232232
For DatetimeArray `values` (or a Series or Index boxing one),
233-
`dtype` and `freq` will be extracted from `values`, with
234-
precedence given to
233+
`dtype` and `freq` will be extracted from `values`.
235234
236235
dtype : numpy.dtype or DatetimeTZDtype
237236
Note that the only NumPy dtype allowed is 'datetime64[ns]'.
238237
freq : str or Offset, optional
238+
The frequency.
239239
copy : bool, default False
240240
Whether to copy the underlying array of values.
241241

pandas/core/arrays/period.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,9 @@ def to_timestamp(self, freq=None, how="start"):
440440
----------
441441
freq : str or DateOffset, optional
442442
Target frequency. The default is 'D' for week or longer,
443-
'S' otherwise
443+
'S' otherwise.
444444
how : {'s', 'e', 'start', 'end'}
445+
Whether to use the start or end of the time period being converted.
445446
446447
Returns
447448
-------
@@ -528,17 +529,20 @@ def asfreq(self, freq=None, how="E"):
528529
Parameters
529530
----------
530531
freq : str
531-
a frequency
532+
A frequency.
532533
how : str {'E', 'S'}
533-
'E', 'END', or 'FINISH' for end,
534-
'S', 'START', or 'BEGIN' for start.
535534
Whether the elements should be aligned to the end
536-
or start within pa period. January 31st ('END') vs.
537-
January 1st ('START') for example.
535+
or start within pa period.
536+
537+
* 'E', 'END', or 'FINISH' for end,
538+
* 'S', 'START', or 'BEGIN' for start.
539+
540+
January 31st ('END') vs. January 1st ('START') for example.
538541
539542
Returns
540543
-------
541-
new : Period Array/Index with the new frequency
544+
Period Array/Index
545+
Constructed with the new frequency.
542546
543547
Examples
544548
--------

pandas/core/frame.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,12 @@
142142
Name or list of names to sort by.
143143
144144
- if `axis` is 0 or `'index'` then `by` may contain index
145-
levels and/or column labels
145+
levels and/or column labels.
146146
- if `axis` is 1 or `'columns'` then `by` may contain column
147-
levels and/or index labels
147+
levels and/or index labels.
148148
149149
.. versionchanged:: 0.23.0
150+
150151
Allow specifying index or column level names.""",
151152
versionadded_to_excel="",
152153
optional_labels="""labels : array-like, optional
@@ -2148,9 +2149,10 @@ def to_html(
21482149
A ``border=border`` attribute is included in the opening
21492150
`<table>` tag. Default ``pd.options.display.html.border``.
21502151
encoding : str, default "utf-8"
2151-
Set character encoding
2152+
Set character encoding.
21522153
21532154
.. versionadded:: 1.0
2155+
21542156
table_id : str, optional
21552157
A css id is included in the opening `<table>` tag if specified.
21562158
@@ -7877,7 +7879,7 @@ def idxmin(self, axis=0, skipna=True):
78777879
Parameters
78787880
----------
78797881
axis : {0 or 'index', 1 or 'columns'}, default 0
7880-
The axis to use. 0 or 'index' for row-wise, 1 or 'columns' for column-wise
7882+
The axis to use. 0 or 'index' for row-wise, 1 or 'columns' for column-wise.
78817883
skipna : bool, default True
78827884
Exclude NA/null values. If an entire row/column is NA, the result
78837885
will be NA.
@@ -7915,7 +7917,7 @@ def idxmax(self, axis=0, skipna=True):
79157917
Parameters
79167918
----------
79177919
axis : {0 or 'index', 1 or 'columns'}, default 0
7918-
The axis to use. 0 or 'index' for row-wise, 1 or 'columns' for column-wise
7920+
The axis to use. 0 or 'index' for row-wise, 1 or 'columns' for column-wise.
79197921
skipna : bool, default True
79207922
Exclude NA/null values. If an entire row/column is NA, the result
79217923
will be NA.

pandas/core/groupby/groupby.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -2099,17 +2099,17 @@ def rank(
20992099
Parameters
21002100
----------
21012101
method : {'average', 'min', 'max', 'first', 'dense'}, default 'average'
2102-
* average: average rank of group
2103-
* min: lowest rank in group
2104-
* max: highest rank in group
2105-
* first: ranks assigned in order they appear in the array
2106-
* dense: like 'min', but rank always increases by 1 between groups
2102+
* average: average rank of group.
2103+
* min: lowest rank in group.
2104+
* max: highest rank in group.
2105+
* first: ranks assigned in order they appear in the array.
2106+
* dense: like 'min', but rank always increases by 1 between groups.
21072107
ascending : bool, default True
21082108
False for ranks by high (1) to low (N).
21092109
na_option : {'keep', 'top', 'bottom'}, default 'keep'
2110-
* keep: leave NA values where they are
2111-
* top: smallest rank if ascending
2112-
* bottom: smallest rank if descending
2110+
* keep: leave NA values where they are.
2111+
* top: smallest rank if ascending.
2112+
* bottom: smallest rank if descending.
21132113
pct : bool, default False
21142114
Compute percentage rank of data within each group.
21152115
axis : int, default 0

pandas/core/groupby/grouper.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434

3535
class Grouper:
3636
"""
37-
A Grouper allows the user to specify a groupby instruction for a target
38-
object.
37+
A Grouper allows the user to specify a groupby instruction for an object.
3938
4039
This specification will select a column via the key parameter, or if the
4140
level and/or axis parameters are given, a level of the index of the target
@@ -47,17 +46,18 @@ class Grouper:
4746
Parameters
4847
----------
4948
key : str, defaults to None
50-
groupby key, which selects the grouping column of the target
49+
Groupby key, which selects the grouping column of the target.
5150
level : name/number, defaults to None
52-
the level for the target index
51+
The level for the target index.
5352
freq : str / frequency object, defaults to None
5453
This will groupby the specified frequency if the target selection
5554
(via key or level) is a datetime-like object. For full specification
5655
of available frequencies, please see `here
5756
<http://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases>`_.
58-
axis : number/name of the axis, defaults to 0
57+
axis : str, int, defaults to 0
58+
Number/name of the axis.
5959
sort : bool, default to False
60-
whether to sort the resulting labels
60+
Whether to sort the resulting labels.
6161
closed : {'left' or 'right'}
6262
Closed end of interval. Only when `freq` parameter is passed.
6363
label : {'left' or 'right'}

pandas/core/indexes/period.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,17 @@ class PeriodDelegateMixin(DatetimelikeDelegateMixin):
7979
)
8080
class PeriodIndex(DatetimeIndexOpsMixin, Int64Index, PeriodDelegateMixin):
8181
"""
82-
Immutable ndarray holding ordinal values indicating regular periods in
83-
time such as particular years, quarters, months, etc.
82+
Immutable ndarray holding ordinal values indicating regular periods in time.
8483
8584
Index keys are boxed to Period objects which carries the metadata (eg,
8685
frequency information).
8786
8887
Parameters
8988
----------
9089
data : array-like (1d int np.ndarray or PeriodArray), optional
91-
Optional period-like data to construct index with
90+
Optional period-like data to construct index with.
9291
copy : bool
93-
Make a copy of input ndarray
92+
Make a copy of input ndarray.
9493
freq : str or period object, optional
9594
One of pandas period strings or corresponding objects
9695
year : int, array, or Series, default None
@@ -101,7 +100,7 @@ class PeriodIndex(DatetimeIndexOpsMixin, Int64Index, PeriodDelegateMixin):
101100
minute : int, array, or Series, default None
102101
second : int, array, or Series, default None
103102
tz : object, default None
104-
Timezone for converting datetime64 data to Periods
103+
Timezone for converting datetime64 data to Periods.
105104
dtype : str or PeriodDtype, default None
106105
107106
Attributes

pandas/core/window/ewm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def cov(self, other=None, pairwise=None, bias=False, **kwargs):
314314
inputs. In the case of missing elements, only complete pairwise
315315
observations will be used.
316316
bias : bool, default False
317-
Use a standard estimation bias correction
317+
Use a standard estimation bias correction.
318318
**kwargs
319319
Keyword arguments to be passed into func.
320320
"""

pandas/io/excel/_base.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,10 @@ def parse(
526526

527527
class ExcelWriter(metaclass=abc.ABCMeta):
528528
"""
529-
Class for writing DataFrame objects into excel sheets, default is to use
530-
xlwt for xls, openpyxl for xlsx. See DataFrame.to_excel for typical usage.
529+
Class for writing DataFrame objects into excel sheets.
530+
531+
Default is to use xlwt for xls, openpyxl for xlsx.
532+
See DataFrame.to_excel for typical usage.
531533
532534
Parameters
533535
----------
@@ -541,7 +543,7 @@ class ExcelWriter(metaclass=abc.ABCMeta):
541543
Format string for dates written into Excel files (e.g. 'YYYY-MM-DD').
542544
datetime_format : str, default None
543545
Format string for datetime objects written into Excel files.
544-
(e.g. 'YYYY-MM-DD HH:MM:SS')
546+
(e.g. 'YYYY-MM-DD HH:MM:SS').
545547
mode : {'w', 'a'}, default 'w'
546548
File mode to use (write or append).
547549

0 commit comments

Comments
 (0)