Skip to content

Commit f3711cf

Browse files
committed
DOC: Adding parameters address issue sub-points 8 and 10 - 24 (issue pandas-dev#2916)
1 parent 5adcceb commit f3711cf

File tree

5 files changed

+104
-38
lines changed

5 files changed

+104
-38
lines changed

pandas/core/reshape.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -745,11 +745,13 @@ def make_axis_dummies(frame, axis='minor', transform=None):
745745
746746
Parameters
747747
----------
748+
frame : DataFrame
748749
axis : {'major', 'minor'}, default 'minor'
749750
transform : function, default None
750751
Function to apply to axis labels first. For example, to
751-
get "day of week" dummies in a time series regression you might
752-
call:
752+
get "day of week" dummies in a time series regression
753+
you might call::
754+
753755
make_axis_dummies(panel, axis='major',
754756
transform=lambda d: d.weekday())
755757
Returns

pandas/stats/math.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ def newey_west(m, max_lags, nobs, df, nw_overlap=False):
5050
5151
Parameters
5252
----------
53-
m: (N x K)
54-
max_lags: int
55-
nobs: int
53+
m : (N x K)
54+
max_lags : int
55+
nobs : int
5656
Number of observations in model
57-
df: int
57+
df : int
5858
Degrees of freedom in explanatory variables
59-
nw_overlap: boolean
59+
nw_overlap : boolean, default False
60+
Assume data is overlapping
6061
6162
Returns
6263
-------

pandas/stats/moments.py

+17-8
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ def rolling_count(arg, window, freq=None, center=False, time_rule=None):
137137
Frequency to conform to before computing statistic
138138
center : boolean, default False
139139
Whether the label should correspond with center of window
140-
140+
time_rule : Legacy alias for freq
141+
141142
Returns
142143
-------
143144
rolling_count : type of caller
@@ -268,7 +269,8 @@ def _rolling_moment(arg, window, func, minp, axis=0, freq=None,
268269
Frequency to conform to before computing statistic
269270
center : boolean, default False
270271
Whether the label should correspond with center of window
271-
272+
time_rule : Legacy alias for freq
273+
272274
Returns
273275
-------
274276
y : type of input
@@ -540,7 +542,8 @@ def rolling_quantile(arg, window, quantile, min_periods=None, freq=None,
540542
Frequency to conform to before computing statistic
541543
center : boolean, default False
542544
Whether the label should correspond with center of window
543-
545+
time_rule : Legacy alias for freq
546+
544547
Returns
545548
-------
546549
y : type of input argument
@@ -569,7 +572,8 @@ def rolling_apply(arg, window, func, min_periods=None, freq=None,
569572
Frequency to conform to before computing statistic
570573
center : boolean, default False
571574
Whether the label should correspond with center of window
572-
575+
time_rule : Legacy alias for freq
576+
573577
Returns
574578
-------
575579
y : type of input argument
@@ -604,7 +608,9 @@ def rolling_window(arg, window=None, win_type=None, min_periods=None,
604608
Whether the label should correspond with center of window
605609
mean : boolean, default True
606610
If True computes weighted mean, else weighted sum
607-
611+
time_rule : Legacy alias for freq
612+
axis : {0, 1}, default 0
613+
608614
Returns
609615
-------
610616
y : type of input argument
@@ -729,7 +735,8 @@ def expanding_count(arg, freq=None, center=False, time_rule=None):
729735
Frequency to conform to before computing statistic
730736
center : boolean, default False
731737
Whether the label should correspond with center of window
732-
738+
time_rule : Legacy alias for freq
739+
733740
Returns
734741
-------
735742
expanding_count : type of caller
@@ -752,7 +759,8 @@ def expanding_quantile(arg, quantile, min_periods=1, freq=None,
752759
Frequency to conform to before computing statistic
753760
center : boolean, default False
754761
Whether the label should correspond with center of window
755-
762+
time_rule : Legacy alias for freq
763+
756764
Returns
757765
-------
758766
y : type of input argument
@@ -816,7 +824,8 @@ def expanding_apply(arg, func, min_periods=1, freq=None, center=False,
816824
Frequency to conform to before computing statistic
817825
center : boolean, default False
818826
Whether the label should correspond with center of window
819-
827+
time_rule : Legacy alias for freq
828+
820829
Returns
821830
-------
822831
y : type of input argument

pandas/stats/ols.py

+31-14
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,19 @@ class OLS(object):
2828
2929
Parameters
3030
----------
31-
y: Series
32-
x: Series, DataFrame, dict of Series
33-
intercept: bool
31+
y : Series
32+
x : Series, DataFrame, dict of Series
33+
intercept : bool
3434
True if you want an intercept.
35-
nw_lags: None or int
35+
weights : array-like, optional
36+
1d array of weights. If you supply 1/W then the variables are pre-
37+
multiplied by 1/sqrt(W). If no weights are supplied the default value
38+
is 1 and WLS reults are the same as OLS.
39+
nw_lags : None or int
3640
Number of Newey-West lags.
41+
nw_overlap : boolean, default False
42+
Assume data is overlapping when computing Newey-West estimator
43+
3744
"""
3845
_panel_model = False
3946

@@ -593,16 +600,24 @@ class MovingOLS(OLS):
593600
594601
Parameters
595602
----------
596-
y: Series
597-
x: Series, DataFrame, or dict of Series
598-
intercept: bool
599-
True if you want an intercept.
600-
nw_lags: None or int
601-
Number of Newey-West lags.
602-
window_type: {'full sample', 'rolling', 'expanding'}
603+
y : Series
604+
x : Series, DataFrame, or dict of Series
605+
weights : array-like, optional
606+
1d array of weights. If None, equivalent to an unweighted OLS.
607+
window_type : {'full sample', 'rolling', 'expanding'}
603608
Default expanding
604-
window: int
609+
window : int
605610
size of window (for rolling/expanding OLS)
611+
min_periods : int
612+
Threshold of non-null data points to require.
613+
If None, defaults to size of window.
614+
intercept : bool
615+
True if you want an intercept.
616+
nw_lags : None or int
617+
Number of Newey-West lags.
618+
nw_overlap : boolean, default False
619+
Assume data is overlapping when computing Newey-West estimator
620+
606621
"""
607622
def __init__(self, y, x, weights=None, window_type='expanding',
608623
window=None, min_periods=None, intercept=True,
@@ -1246,10 +1261,12 @@ def _filter_data(lhs, rhs, weights=None):
12461261
12471262
Parameters
12481263
----------
1249-
lhs: Series
1264+
lhs : Series
12501265
Dependent variable in the regression.
1251-
rhs: dict, whose values are Series, DataFrame, or dict
1266+
rhs : dict, whose values are Series, DataFrame, or dict
12521267
Explanatory variables of the regression.
1268+
weights : array-like, optional
1269+
1d array of weights. If None, equivalent to an unweighted OLS.
12531270
12541271
Returns
12551272
-------

pandas/tools/plotting.py

+46-9
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,15 @@ def scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False,
165165
166166
Parameters
167167
----------
168+
frame : DataFrame
168169
alpha : amount of transparency applied
169170
figsize : a tuple (width, height) in inches
170171
ax : Matplotlib axis object
171172
grid : setting this to True will show the grid
172173
diagonal : pick between 'kde' and 'hist' for
173174
either Kernel Density Estimation or Histogram
174175
plot in the diagonal
176+
marker : Matplotlib marker type, default '.'
175177
kwds : other plotting keyword arguments
176178
To be passed to scatter function
177179
@@ -365,10 +367,17 @@ def normalize(series):
365367
def andrews_curves(data, class_column, ax=None, samples=200):
366368
"""
367369
Parameters:
368-
data: A DataFrame containing data to be plotted, preferably
369-
normalized to (0.0, 1.0).
370-
class_column: Name of the column containing class names.
371-
samples: Number of points to plot in each curve.
370+
-----------
371+
data : DataFrame
372+
Data to be plotted, preferably normalized to (0.0, 1.0)
373+
class_column : Name of the column containing class names
374+
ax : matplotlib axes object, default None
375+
samples : Number of points to plot in each curve
376+
377+
Returns:
378+
--------
379+
ax: Matplotlib axis object
380+
372381
"""
373382
from math import sqrt, pi, sin, cos
374383
import matplotlib.pyplot as plt
@@ -1475,6 +1484,7 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
14751484
14761485
Parameters
14771486
----------
1487+
frame : DataFrame
14781488
x : label or position, default None
14791489
y : label or position, default None
14801490
Allows plotting of one column versus another
@@ -1675,8 +1685,11 @@ def boxplot(data, column=None, by=None, ax=None, fontsize=None,
16751685
Can be any valid input to groupby
16761686
by : string or sequence
16771687
Column in the DataFrame to group by
1688+
ax : Matplotlib axis object, optional
16781689
fontsize : int or string
16791690
rot : label rotation angle
1691+
figsize : A tuple (width, height) in inches
1692+
grid : Setting this to True will show the grid
16801693
kwds : other plotting keyword arguments to be passed to matplotlib boxplot
16811694
function
16821695
@@ -1779,7 +1792,19 @@ def format_date_labels(ax, rot):
17791792

17801793
def scatter_plot(data, x, y, by=None, ax=None, figsize=None, grid=False, **kwargs):
17811794
"""
1795+
Make a scatter plot from two DataFrame columns
17821796
1797+
Parameters
1798+
----------
1799+
data : DataFrame
1800+
x : Column name for the x-axis values
1801+
y : Column name for the y-axis values
1802+
ax : Matplotlib axis object
1803+
figsize : A tuple (width, height) in inches
1804+
grid : Setting this to True will show the grid
1805+
kwargs : other plotting keyword arguments
1806+
To be passed to scatter function
1807+
17831808
Returns
17841809
-------
17851810
fig : matplotlib.Figure
@@ -1818,6 +1843,11 @@ def hist_frame(
18181843
18191844
Parameters
18201845
----------
1846+
data : DataFrame
1847+
column : string or sequence
1848+
If passed, will be used to limit data to a subset of columns
1849+
by : object, optional
1850+
If passed, then used to form histograms for separate groups
18211851
grid : boolean, default True
18221852
Whether to show axis grid lines
18231853
xlabelsize : int, default None
@@ -1956,13 +1986,16 @@ def boxplot_frame_groupby(grouped, subplots=True, column=None, fontsize=None,
19561986
19571987
Parameters
19581988
----------
1989+
grouped : Grouped DataFrame
19591990
subplots :
19601991
* ``False`` - no subplots will be used
19611992
* ``True`` - create a subplot for each group
19621993
column : column name or list of names, or vector
19631994
Can be any valid input to groupby
19641995
fontsize : int or string
19651996
rot : label rotation angle
1997+
grid : Setting this to True will show the grid
1998+
figsize : A tuple (width, height) in inches
19661999
kwds : other plotting keyword arguments to be passed to matplotlib boxplot
19672000
function
19682001
@@ -2157,15 +2190,19 @@ def _subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
21572190
Dict with keywords passed to the add_subplot() call used to create each
21582191
subplots.
21592192
2160-
fig_kw : dict
2161-
Dict with keywords passed to the figure() call. Note that all keywords
2162-
not recognized above will be automatically included here.
2163-
2164-
ax : Matplotlib axis object, default None
2193+
ax : Matplotlib axis object, optional
21652194
21662195
secondary_y : boolean or sequence of ints, default False
21672196
If True then y-axis will be on the right
21682197
2198+
data : DataFrame, optional
2199+
If secondary_y is a sequence, data is used to select columns.
2200+
2201+
fig_kw : Other keyword arguments to be passed to the figure() call.
2202+
Note that all keywords not recognized above will be
2203+
automatically included here.
2204+
2205+
21692206
Returns:
21702207
21712208
fig, ax : tuple

0 commit comments

Comments
 (0)