Skip to content

Commit c80ff12

Browse files
thooJustinZhengBC
authored andcommitted
DOC: Fix Order of parameters in docstrings (pandas-dev#23611)
1 parent fef6d7a commit c80ff12

File tree

5 files changed

+26
-27
lines changed

5 files changed

+26
-27
lines changed

pandas/core/reshape/pivot.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,12 @@ def crosstab(index, columns, values=None, rownames=None, colnames=None,
407407
values : array-like, optional
408408
Array of values to aggregate according to the factors.
409409
Requires `aggfunc` be specified.
410-
aggfunc : function, optional
411-
If specified, requires `values` be specified as well
412410
rownames : sequence, default None
413411
If passed, must match number of row arrays passed
414412
colnames : sequence, default None
415413
If passed, must match number of column arrays passed
414+
aggfunc : function, optional
415+
If specified, requires `values` be specified as well
416416
margins : boolean, default False
417417
Add row/column margins (subtotals)
418418
margins_name : string, default 'All'

pandas/core/window.py

+17-18
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _gotitem(self, key, ndim, subset=None):
136136
137137
Parameters
138138
----------
139-
key : string / list of selections
139+
key : str / list of selections
140140
ndim : 1,2
141141
requested ndim of result
142142
subset : object, default None
@@ -464,15 +464,16 @@ class Window(_Window):
464464
(otherwise result is NA). For a window that is specified by an offset,
465465
`min_periods` will default to 1. Otherwise, `min_periods` will default
466466
to the size of the window.
467-
center : boolean, default False
467+
center : bool, default False
468468
Set the labels at the center of the window.
469-
win_type : string, default None
469+
win_type : str, default None
470470
Provide a window type. If ``None``, all points are evenly weighted.
471471
See the notes below for further information.
472-
on : string, optional
472+
on : str, optional
473473
For a DataFrame, column on which to calculate
474474
the rolling window, rather than the index
475-
closed : string, default None
475+
axis : int or str, default 0
476+
closed : str, default None
476477
Make the interval closed on the 'right', 'left', 'both' or
477478
'neither' endpoints.
478479
For offset-based windows, it defaults to 'right'.
@@ -481,8 +482,6 @@ class Window(_Window):
481482
482483
.. versionadded:: 0.20.0
483484
484-
axis : int or string, default 0
485-
486485
Returns
487486
-------
488487
a Window or Rolling sub-classed for the particular operation
@@ -661,7 +660,7 @@ def _apply_window(self, mean=True, **kwargs):
661660
662661
Parameters
663662
----------
664-
mean : boolean, default True
663+
mean : bool, default True
665664
If True computes weighted mean, else weighted sum
666665
667666
Returns
@@ -819,11 +818,11 @@ def _apply(self, func, name=None, window=None, center=None,
819818
820819
Parameters
821820
----------
822-
func : string/callable to apply
823-
name : string, optional
821+
func : str/callable to apply
822+
name : str, optional
824823
name of this function
825824
window : int/array, default to _get_window()
826-
center : boolean, default to self.center
825+
center : bool, default to self.center
827826
check_minp : function, default to _use_window
828827
829828
Returns
@@ -1816,9 +1815,9 @@ class Expanding(_Rolling_and_Expanding):
18161815
min_periods : int, default 1
18171816
Minimum number of observations in window required to have a value
18181817
(otherwise result is NA).
1819-
center : boolean, default False
1818+
center : bool, default False
18201819
Set the labels at the center of the window.
1821-
axis : int or string, default 0
1820+
axis : int or str, default 0
18221821
18231822
Returns
18241823
-------
@@ -2062,7 +2061,7 @@ def _constructor(self):
20622061
20632062
Parameters
20642063
----------
2065-
bias : boolean, default False
2064+
bias : bool, default False
20662065
Use a standard estimation bias correction
20672066
"""
20682067

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

@@ -2110,10 +2109,10 @@ class EWM(_Rolling):
21102109
min_periods : int, default 0
21112110
Minimum number of observations in window required to have a value
21122111
(otherwise result is NA).
2113-
adjust : boolean, default True
2112+
adjust : bool, default True
21142113
Divide by decaying adjustment factor in beginning periods to account
21152114
for imbalance in relative weightings (viewing EWMA as a moving average)
2116-
ignore_na : boolean, default False
2115+
ignore_na : bool, default False
21172116
Ignore missing values when calculating weights;
21182117
specify True to reproduce pre-0.15.0 behavior
21192118
@@ -2242,7 +2241,7 @@ def _apply(self, func, **kwargs):
22422241
22432242
Parameters
22442243
----------
2245-
func : string/callable to apply
2244+
func : str/callable to apply
22462245
22472246
Returns
22482247
-------

pandas/io/json/normalize.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ def json_normalize(data, record_path=None, meta=None,
110110
assumed to be an array of records
111111
meta : list of paths (string or list of strings), default None
112112
Fields to use as metadata for each record in resulting table
113+
meta_prefix : string, default None
113114
record_prefix : string, default None
114115
If True, prefix records with dotted (?) path, e.g. foo.bar.field if
115116
path to records is ['foo', 'bar']
116-
meta_prefix : string, default None
117117
errors : {'raise', 'ignore'}, default 'raise'
118118
119119
* 'ignore' : will ignore KeyError if keys listed in meta are not

pandas/tseries/offsets.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,6 @@ class CustomBusinessDay(_CustomMixin, BusinessDay):
807807
Parameters
808808
----------
809809
n : int, default 1
810-
offset : timedelta, default timedelta(0)
811810
normalize : bool, default False
812811
Normalize start/end dates to midnight before generating date range
813812
weekmask : str, Default 'Mon Tue Wed Thu Fri'
@@ -816,6 +815,7 @@ class CustomBusinessDay(_CustomMixin, BusinessDay):
816815
list/array of dates to exclude from the set of valid business days,
817816
passed to ``numpy.busdaycalendar``
818817
calendar : pd.HolidayCalendar or np.busdaycalendar
818+
offset : timedelta, default timedelta(0)
819819
"""
820820
_prefix = 'C'
821821
_attributes = frozenset(['n', 'normalize',
@@ -958,7 +958,6 @@ class _CustomBusinessMonth(_CustomMixin, BusinessMixin, MonthOffset):
958958
Parameters
959959
----------
960960
n : int, default 1
961-
offset : timedelta, default timedelta(0)
962961
normalize : bool, default False
963962
Normalize start/end dates to midnight before generating date range
964963
weekmask : str, Default 'Mon Tue Wed Thu Fri'
@@ -967,6 +966,7 @@ class _CustomBusinessMonth(_CustomMixin, BusinessMixin, MonthOffset):
967966
list/array of dates to exclude from the set of valid business days,
968967
passed to ``numpy.busdaycalendar``
969968
calendar : pd.HolidayCalendar or np.busdaycalendar
969+
offset : timedelta, default timedelta(0)
970970
"""
971971
_attributes = frozenset(['n', 'normalize',
972972
'weekmask', 'holidays', 'calendar', 'offset'])

pandas/util/testing.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1242,18 +1242,18 @@ def assert_series_equal(left, right, check_dtype=True,
12421242
check_less_precise : bool or int, default False
12431243
Specify comparison precision. Only used when check_exact is False.
12441244
5 digits (False) or 3 digits (True) after decimal points are compared.
1245-
If int, then specify the digits to compare
1246-
check_exact : bool, default False
1247-
Whether to compare number exactly.
1245+
If int, then specify the digits to compare.
12481246
check_names : bool, default True
12491247
Whether to check the Series and Index names attribute.
1248+
check_exact : bool, default False
1249+
Whether to compare number exactly.
12501250
check_datetimelike_compat : bool, default False
12511251
Compare datetime-like which is comparable ignoring dtype.
12521252
check_categorical : bool, default True
12531253
Whether to compare internal Categorical exactly.
12541254
obj : str, default 'Series'
12551255
Specify object name being compared, internally used to show appropriate
1256-
assertion message
1256+
assertion message.
12571257
"""
12581258
__tracebackhide__ = True
12591259

0 commit comments

Comments
 (0)