From e08d27e578c6c95ed7ba019c7a1199b60dcc599d Mon Sep 17 00:00:00 2001 From: Matt Roeschke Date: Sat, 3 Dec 2016 21:55:19 -0800 Subject: [PATCH] First typo fixes Fix broken hyperlink on resample colon spacing remove comment from printing to docstring address linting errors pep8 fixes pep8 changes --- pandas/core/frame.py | 2 +- pandas/core/generic.py | 24 +++++++++++++++--------- pandas/core/ops.py | 2 +- pandas/core/series.py | 4 ++-- pandas/tools/plotting.py | 5 +++-- pandas/tseries/index.py | 2 +- 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 0053135e1fd85..0d4bcd781cf74 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -2483,7 +2483,7 @@ def assign(self, **kwargs): Notes ----- Since ``kwargs`` is a dictionary, the order of your - arguments may not be preserved. The make things predicatable, + arguments may not be preserved. To make things predicatable, the columns are inserted in alphabetical order, at the end of your DataFrame. Assigning multiple columns within the same ``assign`` is possible, but you cannot reference other columns diff --git a/pandas/core/generic.py b/pandas/core/generic.py index b7e43d6fe01e8..64e3d60e1fe14 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3635,14 +3635,17 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None, require that you also specify an `order` (int), e.g. df.interpolate(method='polynomial', order=4). These use the actual numerical values of the index. - * 'krogh', 'piecewise_polynomial', 'spline', 'pchip' and 'akima' are all - wrappers around the scipy interpolation methods of similar - names. These use the actual numerical values of the index. See - the scipy documentation for more on their behavior - `here `__ # noqa - `and here `__ # noqa + * 'krogh', 'piecewise_polynomial', 'spline', 'pchip' and 'akima' + are all wrappers around the scipy interpolation methods of + similar names. These use the actual numerical values of the + index. For more information on their behavior, see the + `scipy documentation + `__ + and `tutorial documentation + `__ * 'from_derivatives' refers to BPoly.from_derivatives which - replaces 'piecewise_polynomial' interpolation method in scipy 0.18 + replaces 'piecewise_polynomial' interpolation method in + scipy 0.18 .. versionadded:: 0.18.1 @@ -3656,7 +3659,7 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None, * 1: fill row-by-row limit : int, default None. Maximum number of consecutive NaNs to fill. - limit_direction : {'forward', 'backward', 'both'}, defaults to 'forward' + limit_direction : {'forward', 'backward', 'both'}, default 'forward' If limit is specified, consecutive NaNs will be filled in this direction. @@ -4159,6 +4162,9 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None, .. versionadded:: 0.19.0 + Notes + ----- + To learn more about the offset strings, please see `this link `__. @@ -4346,7 +4352,7 @@ def rank(self, axis=0, method='average', numeric_only=None, Parameters ---------- - axis: {0 or 'index', 1 or 'columns'}, default 0 + axis : {0 or 'index', 1 or 'columns'}, default 0 index to direct ranking method : {'average', 'min', 'max', 'first', 'dense'} * average: average rank of group diff --git a/pandas/core/ops.py b/pandas/core/ops.py index 7c5ad04cc90b0..80de3cd85d4db 100644 --- a/pandas/core/ops.py +++ b/pandas/core/ops.py @@ -1006,7 +1006,7 @@ def wrapper(self, other): Parameters ---------- -other: Series or scalar value +other : Series or scalar value fill_value : None or float value, default None (NaN) Fill missing (NaN) values with this value. If both Series are missing, the result will be missing diff --git a/pandas/core/series.py b/pandas/core/series.py index 958cf183578dd..7018865e5b3ec 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2033,9 +2033,9 @@ def reorder_levels(self, order): Parameters ---------- - order: list of int representing new level order. + order : list of int representing new level order. (reference level by number or key) - axis: where to reorder levels + axis : where to reorder levels Returns ------- diff --git a/pandas/tools/plotting.py b/pandas/tools/plotting.py index d46dc4d355b4c..e4cf896a89f57 100644 --- a/pandas/tools/plotting.py +++ b/pandas/tools/plotting.py @@ -2893,8 +2893,9 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None, invisible figsize : tuple The size of the figure to create in inches by default - layout: (optional) a tuple (rows, columns) for the layout of the histograms - bins: integer, default 10 + layout : tuple, optional + Tuple of (rows, columns) for the layout of the histograms + bins : integer, default 10 Number of histogram bins to be used kwds : other plotting keyword arguments To be passed to hist function diff --git a/pandas/tseries/index.py b/pandas/tseries/index.py index 0824072cc383f..3edf75fbb82ae 100644 --- a/pandas/tseries/index.py +++ b/pandas/tseries/index.py @@ -2000,7 +2000,7 @@ def date_range(start=None, end=None, periods=None, freq='D', tz=None, Frequency strings can have multiples, e.g. '5H' tz : string or None Time zone name for returning localized DatetimeIndex, for example - Asia/Hong_Kong + Asia/Hong_Kong normalize : bool, default False Normalize start/end dates to midnight before generating date range name : str, default None