Skip to content

Commit

Permalink
DOC: Fix Order of parameters in docstrings (#23611)
Browse files Browse the repository at this point in the history
  • Loading branch information
thoo authored and jreback committed Nov 11, 2018
1 parent 602f6ff commit 00ca0f9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 27 deletions.
4 changes: 2 additions & 2 deletions pandas/core/reshape/pivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,12 @@ def crosstab(index, columns, values=None, rownames=None, colnames=None,
values : array-like, optional
Array of values to aggregate according to the factors.
Requires `aggfunc` be specified.
aggfunc : function, optional
If specified, requires `values` be specified as well
rownames : sequence, default None
If passed, must match number of row arrays passed
colnames : sequence, default None
If passed, must match number of column arrays passed
aggfunc : function, optional
If specified, requires `values` be specified as well
margins : boolean, default False
Add row/column margins (subtotals)
margins_name : string, default 'All'
Expand Down
35 changes: 17 additions & 18 deletions pandas/core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def _gotitem(self, key, ndim, subset=None):
Parameters
----------
key : string / list of selections
key : str / list of selections
ndim : 1,2
requested ndim of result
subset : object, default None
Expand Down Expand Up @@ -464,15 +464,16 @@ class Window(_Window):
(otherwise result is NA). For a window that is specified by an offset,
`min_periods` will default to 1. Otherwise, `min_periods` will default
to the size of the window.
center : boolean, default False
center : bool, default False
Set the labels at the center of the window.
win_type : string, default None
win_type : str, default None
Provide a window type. If ``None``, all points are evenly weighted.
See the notes below for further information.
on : string, optional
on : str, optional
For a DataFrame, column on which to calculate
the rolling window, rather than the index
closed : string, default None
axis : int or str, default 0
closed : str, default None
Make the interval closed on the 'right', 'left', 'both' or
'neither' endpoints.
For offset-based windows, it defaults to 'right'.
Expand All @@ -481,8 +482,6 @@ class Window(_Window):
.. versionadded:: 0.20.0
axis : int or string, default 0
Returns
-------
a Window or Rolling sub-classed for the particular operation
Expand Down Expand Up @@ -661,7 +660,7 @@ def _apply_window(self, mean=True, **kwargs):
Parameters
----------
mean : boolean, default True
mean : bool, default True
If True computes weighted mean, else weighted sum
Returns
Expand Down Expand Up @@ -819,11 +818,11 @@ def _apply(self, func, name=None, window=None, center=None,
Parameters
----------
func : string/callable to apply
name : string, optional
func : str/callable to apply
name : str, optional
name of this function
window : int/array, default to _get_window()
center : boolean, default to self.center
center : bool, default to self.center
check_minp : function, default to _use_window
Returns
Expand Down Expand Up @@ -1816,9 +1815,9 @@ class Expanding(_Rolling_and_Expanding):
min_periods : int, default 1
Minimum number of observations in window required to have a value
(otherwise result is NA).
center : boolean, default False
center : bool, default False
Set the labels at the center of the window.
axis : int or string, default 0
axis : int or str, default 0
Returns
-------
Expand Down Expand Up @@ -2062,7 +2061,7 @@ def _constructor(self):
Parameters
----------
bias : boolean, default False
bias : bool, default False
Use a standard estimation bias correction
"""

Expand All @@ -2079,7 +2078,7 @@ def _constructor(self):
will be a MultiIndex DataFrame in the case of DataFrame inputs.
In the case of missing elements, only complete pairwise observations will
be used.
bias : boolean, default False
bias : bool, default False
Use a standard estimation bias correction
"""

Expand Down Expand Up @@ -2110,10 +2109,10 @@ class EWM(_Rolling):
min_periods : int, default 0
Minimum number of observations in window required to have a value
(otherwise result is NA).
adjust : boolean, default True
adjust : bool, default True
Divide by decaying adjustment factor in beginning periods to account
for imbalance in relative weightings (viewing EWMA as a moving average)
ignore_na : boolean, default False
ignore_na : bool, default False
Ignore missing values when calculating weights;
specify True to reproduce pre-0.15.0 behavior
Expand Down Expand Up @@ -2242,7 +2241,7 @@ def _apply(self, func, **kwargs):
Parameters
----------
func : string/callable to apply
func : str/callable to apply
Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/json/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ def json_normalize(data, record_path=None, meta=None,
assumed to be an array of records
meta : list of paths (string or list of strings), default None
Fields to use as metadata for each record in resulting table
meta_prefix : string, default None
record_prefix : string, default None
If True, prefix records with dotted (?) path, e.g. foo.bar.field if
path to records is ['foo', 'bar']
meta_prefix : string, default None
errors : {'raise', 'ignore'}, default 'raise'
* 'ignore' : will ignore KeyError if keys listed in meta are not
Expand Down
4 changes: 2 additions & 2 deletions pandas/tseries/offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,6 @@ class CustomBusinessDay(_CustomMixin, BusinessDay):
Parameters
----------
n : int, default 1
offset : timedelta, default timedelta(0)
normalize : bool, default False
Normalize start/end dates to midnight before generating date range
weekmask : str, Default 'Mon Tue Wed Thu Fri'
Expand All @@ -816,6 +815,7 @@ class CustomBusinessDay(_CustomMixin, BusinessDay):
list/array of dates to exclude from the set of valid business days,
passed to ``numpy.busdaycalendar``
calendar : pd.HolidayCalendar or np.busdaycalendar
offset : timedelta, default timedelta(0)
"""
_prefix = 'C'
_attributes = frozenset(['n', 'normalize',
Expand Down Expand Up @@ -958,7 +958,6 @@ class _CustomBusinessMonth(_CustomMixin, BusinessMixin, MonthOffset):
Parameters
----------
n : int, default 1
offset : timedelta, default timedelta(0)
normalize : bool, default False
Normalize start/end dates to midnight before generating date range
weekmask : str, Default 'Mon Tue Wed Thu Fri'
Expand All @@ -967,6 +966,7 @@ class _CustomBusinessMonth(_CustomMixin, BusinessMixin, MonthOffset):
list/array of dates to exclude from the set of valid business days,
passed to ``numpy.busdaycalendar``
calendar : pd.HolidayCalendar or np.busdaycalendar
offset : timedelta, default timedelta(0)
"""
_attributes = frozenset(['n', 'normalize',
'weekmask', 'holidays', 'calendar', 'offset'])
Expand Down
8 changes: 4 additions & 4 deletions pandas/util/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1242,18 +1242,18 @@ def assert_series_equal(left, right, check_dtype=True,
check_less_precise : bool or int, default False
Specify comparison precision. Only used when check_exact is False.
5 digits (False) or 3 digits (True) after decimal points are compared.
If int, then specify the digits to compare
check_exact : bool, default False
Whether to compare number exactly.
If int, then specify the digits to compare.
check_names : bool, default True
Whether to check the Series and Index names attribute.
check_exact : bool, default False
Whether to compare number exactly.
check_datetimelike_compat : bool, default False
Compare datetime-like which is comparable ignoring dtype.
check_categorical : bool, default True
Whether to compare internal Categorical exactly.
obj : str, default 'Series'
Specify object name being compared, internally used to show appropriate
assertion message
assertion message.
"""
__tracebackhide__ = True

Expand Down

0 comments on commit 00ca0f9

Please sign in to comment.