Skip to content

Commit

Permalink
DOC: Adding parameters address issue sub-points 8 and 10 - 24 (issue p…
Browse files Browse the repository at this point in the history
  • Loading branch information
karmel committed Apr 23, 2013
1 parent 5adcceb commit f3711cf
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 38 deletions.
6 changes: 4 additions & 2 deletions pandas/core/reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,11 +745,13 @@ def make_axis_dummies(frame, axis='minor', transform=None):
Parameters
----------
frame : DataFrame
axis : {'major', 'minor'}, default 'minor'
transform : function, default None
Function to apply to axis labels first. For example, to
get "day of week" dummies in a time series regression you might
call:
get "day of week" dummies in a time series regression
you might call::
make_axis_dummies(panel, axis='major',
transform=lambda d: d.weekday())
Returns
Expand Down
11 changes: 6 additions & 5 deletions pandas/stats/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ def newey_west(m, max_lags, nobs, df, nw_overlap=False):
Parameters
----------
m: (N x K)
max_lags: int
nobs: int
m : (N x K)
max_lags : int
nobs : int
Number of observations in model
df: int
df : int
Degrees of freedom in explanatory variables
nw_overlap: boolean
nw_overlap : boolean, default False
Assume data is overlapping
Returns
-------
Expand Down
25 changes: 17 additions & 8 deletions pandas/stats/moments.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def rolling_count(arg, window, freq=None, center=False, time_rule=None):
Frequency to conform to before computing statistic
center : boolean, default False
Whether the label should correspond with center of window
time_rule : Legacy alias for freq
Returns
-------
rolling_count : type of caller
Expand Down Expand Up @@ -268,7 +269,8 @@ def _rolling_moment(arg, window, func, minp, axis=0, freq=None,
Frequency to conform to before computing statistic
center : boolean, default False
Whether the label should correspond with center of window
time_rule : Legacy alias for freq
Returns
-------
y : type of input
Expand Down Expand Up @@ -540,7 +542,8 @@ def rolling_quantile(arg, window, quantile, min_periods=None, freq=None,
Frequency to conform to before computing statistic
center : boolean, default False
Whether the label should correspond with center of window
time_rule : Legacy alias for freq
Returns
-------
y : type of input argument
Expand Down Expand Up @@ -569,7 +572,8 @@ def rolling_apply(arg, window, func, min_periods=None, freq=None,
Frequency to conform to before computing statistic
center : boolean, default False
Whether the label should correspond with center of window
time_rule : Legacy alias for freq
Returns
-------
y : type of input argument
Expand Down Expand Up @@ -604,7 +608,9 @@ def rolling_window(arg, window=None, win_type=None, min_periods=None,
Whether the label should correspond with center of window
mean : boolean, default True
If True computes weighted mean, else weighted sum
time_rule : Legacy alias for freq
axis : {0, 1}, default 0
Returns
-------
y : type of input argument
Expand Down Expand Up @@ -729,7 +735,8 @@ def expanding_count(arg, freq=None, center=False, time_rule=None):
Frequency to conform to before computing statistic
center : boolean, default False
Whether the label should correspond with center of window
time_rule : Legacy alias for freq
Returns
-------
expanding_count : type of caller
Expand All @@ -752,7 +759,8 @@ def expanding_quantile(arg, quantile, min_periods=1, freq=None,
Frequency to conform to before computing statistic
center : boolean, default False
Whether the label should correspond with center of window
time_rule : Legacy alias for freq
Returns
-------
y : type of input argument
Expand Down Expand Up @@ -816,7 +824,8 @@ def expanding_apply(arg, func, min_periods=1, freq=None, center=False,
Frequency to conform to before computing statistic
center : boolean, default False
Whether the label should correspond with center of window
time_rule : Legacy alias for freq
Returns
-------
y : type of input argument
Expand Down
45 changes: 31 additions & 14 deletions pandas/stats/ols.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,19 @@ class OLS(object):
Parameters
----------
y: Series
x: Series, DataFrame, dict of Series
intercept: bool
y : Series
x : Series, DataFrame, dict of Series
intercept : bool
True if you want an intercept.
nw_lags: None or int
weights : array-like, optional
1d array of weights. If you supply 1/W then the variables are pre-
multiplied by 1/sqrt(W). If no weights are supplied the default value
is 1 and WLS reults are the same as OLS.
nw_lags : None or int
Number of Newey-West lags.
nw_overlap : boolean, default False
Assume data is overlapping when computing Newey-West estimator
"""
_panel_model = False

Expand Down Expand Up @@ -593,16 +600,24 @@ class MovingOLS(OLS):
Parameters
----------
y: Series
x: Series, DataFrame, or dict of Series
intercept: bool
True if you want an intercept.
nw_lags: None or int
Number of Newey-West lags.
window_type: {'full sample', 'rolling', 'expanding'}
y : Series
x : Series, DataFrame, or dict of Series
weights : array-like, optional
1d array of weights. If None, equivalent to an unweighted OLS.
window_type : {'full sample', 'rolling', 'expanding'}
Default expanding
window: int
window : int
size of window (for rolling/expanding OLS)
min_periods : int
Threshold of non-null data points to require.
If None, defaults to size of window.
intercept : bool
True if you want an intercept.
nw_lags : None or int
Number of Newey-West lags.
nw_overlap : boolean, default False
Assume data is overlapping when computing Newey-West estimator
"""
def __init__(self, y, x, weights=None, window_type='expanding',
window=None, min_periods=None, intercept=True,
Expand Down Expand Up @@ -1246,10 +1261,12 @@ def _filter_data(lhs, rhs, weights=None):
Parameters
----------
lhs: Series
lhs : Series
Dependent variable in the regression.
rhs: dict, whose values are Series, DataFrame, or dict
rhs : dict, whose values are Series, DataFrame, or dict
Explanatory variables of the regression.
weights : array-like, optional
1d array of weights. If None, equivalent to an unweighted OLS.
Returns
-------
Expand Down
55 changes: 46 additions & 9 deletions pandas/tools/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,15 @@ def scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False,
Parameters
----------
frame : DataFrame
alpha : amount of transparency applied
figsize : a tuple (width, height) in inches
ax : Matplotlib axis object
grid : setting this to True will show the grid
diagonal : pick between 'kde' and 'hist' for
either Kernel Density Estimation or Histogram
plot in the diagonal
marker : Matplotlib marker type, default '.'
kwds : other plotting keyword arguments
To be passed to scatter function
Expand Down Expand Up @@ -365,10 +367,17 @@ def normalize(series):
def andrews_curves(data, class_column, ax=None, samples=200):
"""
Parameters:
data: A DataFrame containing data to be plotted, preferably
normalized to (0.0, 1.0).
class_column: Name of the column containing class names.
samples: Number of points to plot in each curve.
-----------
data : DataFrame
Data to be plotted, preferably normalized to (0.0, 1.0)
class_column : Name of the column containing class names
ax : matplotlib axes object, default None
samples : Number of points to plot in each curve
Returns:
--------
ax: Matplotlib axis object
"""
from math import sqrt, pi, sin, cos
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -1475,6 +1484,7 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
Parameters
----------
frame : DataFrame
x : label or position, default None
y : label or position, default None
Allows plotting of one column versus another
Expand Down Expand Up @@ -1675,8 +1685,11 @@ def boxplot(data, column=None, by=None, ax=None, fontsize=None,
Can be any valid input to groupby
by : string or sequence
Column in the DataFrame to group by
ax : Matplotlib axis object, optional
fontsize : int or string
rot : label rotation angle
figsize : A tuple (width, height) in inches
grid : Setting this to True will show the grid
kwds : other plotting keyword arguments to be passed to matplotlib boxplot
function
Expand Down Expand Up @@ -1779,7 +1792,19 @@ def format_date_labels(ax, rot):

def scatter_plot(data, x, y, by=None, ax=None, figsize=None, grid=False, **kwargs):
"""
Make a scatter plot from two DataFrame columns
Parameters
----------
data : DataFrame
x : Column name for the x-axis values
y : Column name for the y-axis values
ax : Matplotlib axis object
figsize : A tuple (width, height) in inches
grid : Setting this to True will show the grid
kwargs : other plotting keyword arguments
To be passed to scatter function
Returns
-------
fig : matplotlib.Figure
Expand Down Expand Up @@ -1818,6 +1843,11 @@ def hist_frame(
Parameters
----------
data : DataFrame
column : string or sequence
If passed, will be used to limit data to a subset of columns
by : object, optional
If passed, then used to form histograms for separate groups
grid : boolean, default True
Whether to show axis grid lines
xlabelsize : int, default None
Expand Down Expand Up @@ -1956,13 +1986,16 @@ def boxplot_frame_groupby(grouped, subplots=True, column=None, fontsize=None,
Parameters
----------
grouped : Grouped DataFrame
subplots :
* ``False`` - no subplots will be used
* ``True`` - create a subplot for each group
column : column name or list of names, or vector
Can be any valid input to groupby
fontsize : int or string
rot : label rotation angle
grid : Setting this to True will show the grid
figsize : A tuple (width, height) in inches
kwds : other plotting keyword arguments to be passed to matplotlib boxplot
function
Expand Down Expand Up @@ -2157,15 +2190,19 @@ def _subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
Dict with keywords passed to the add_subplot() call used to create each
subplots.
fig_kw : dict
Dict with keywords passed to the figure() call. Note that all keywords
not recognized above will be automatically included here.
ax : Matplotlib axis object, default None
ax : Matplotlib axis object, optional
secondary_y : boolean or sequence of ints, default False
If True then y-axis will be on the right
data : DataFrame, optional
If secondary_y is a sequence, data is used to select columns.
fig_kw : Other keyword arguments to be passed to the figure() call.
Note that all keywords not recognized above will be
automatically included here.
Returns:
fig, ax : tuple
Expand Down

0 comments on commit f3711cf

Please sign in to comment.