From 61222a247f930fd5ce8e8662388746a0afaa9e48 Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Fri, 27 Sep 2019 13:54:40 +0100 Subject: [PATCH 1/4] DOC: updated core.frame, core.generic and core.plotting._core for PR08 doc errors --- pandas/core/frame.py | 22 +++++++++++++++------- pandas/core/generic.py | 18 +++++++++--------- pandas/plotting/_core.py | 4 +++- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index ed05691d33d07..3d2a9a4d3c5f5 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -2066,7 +2066,7 @@ def to_feather(self, fname): Parameters ---------- fname : str - string file path + String file path. """ from pandas.io.feather_format import to_feather @@ -3462,7 +3462,7 @@ def insert(self, loc, column, value, allow_duplicates=False): loc : int Insertion index. Must verify 0 <= loc <= len(columns) column : string, number, or hashable object - label of the inserted column + Label of the inserted column. value : int, Series, or array-like allow_duplicates : bool, optional """ @@ -4772,6 +4772,7 @@ def drop_duplicates(self, subset=None, keep="first", inplace=False): Only consider certain columns for identifying duplicates, by default use all of the columns keep : {'first', 'last', False}, default 'first' + Determines which duplicates (if any) to keep. - ``first`` : Drop duplicates except for the first occurrence. - ``last`` : Drop duplicates except for the last occurrence. - False : Drop all duplicates. @@ -4806,6 +4807,7 @@ def duplicated(self, subset=None, keep="first"): Only consider certain columns for identifying duplicates, by default use all of the columns keep : {'first', 'last', False}, default 'first' + Determines which duplicates (if any) to mark. - ``first`` : Mark duplicates as ``True`` except for the first occurrence. - ``last`` : Mark duplicates as ``True`` except for the @@ -6233,8 +6235,8 @@ def unstack(self, level=-1, fill_value=None): ---------- level : int, string, or list of these, default -1 (last level) Level(s) of index to unstack, can pass level name - fill_value : replace NaN with this value if the unstack produces - missing values + fill_value : sint, string or dict + Replace NaN with this value if the unstack produces missing values Returns ------- @@ -6665,6 +6667,8 @@ def apply( by result_type='broadcast'. raw : bool, default False + Determines if row or column is passed as a Series or ndarry object: + * ``False`` : passes each row or column as a Series to the function. * ``True`` : the passed function will receive ndarray objects @@ -7357,6 +7361,8 @@ def corr(self, method="pearson", min_periods=1): Parameters ---------- method : {'pearson', 'kendall', 'spearman'} or callable + Method of correlation: + * pearson : standard correlation coefficient * kendall : Kendall Tau correlation coefficient * spearman : Spearman rank correlation @@ -7556,10 +7562,12 @@ def corrwith(self, other, axis=0, drop=False, method="pearson"): other : DataFrame, Series Object with which to compute correlations. axis : {0 or 'index', 1 or 'columns'}, default 0 - 0 or 'index' to compute column-wise, 1 or 'columns' for row-wise. + The axis to use. 0 or 'index' to compute column-wise, 1 or 'columns' for row-wise. drop : bool, default False Drop missing indices from result. method : {'pearson', 'kendall', 'spearman'} or callable + Method of correlation: + * pearson : standard correlation coefficient * kendall : Kendall Tau correlation coefficient * spearman : Spearman rank correlation @@ -7939,7 +7947,7 @@ def idxmin(self, axis=0, skipna=True): Parameters ---------- axis : {0 or 'index', 1 or 'columns'}, default 0 - 0 or 'index' for row-wise, 1 or 'columns' for column-wise + The axis to use. 0 or 'index' for row-wise, 1 or 'columns' for column-wise skipna : boolean, default True Exclude NA/null values. If an entire row/column is NA, the result will be NA. @@ -7976,7 +7984,7 @@ def idxmax(self, axis=0, skipna=True): Parameters ---------- axis : {0 or 'index', 1 or 'columns'}, default 0 - 0 or 'index' for row-wise, 1 or 'columns' for column-wise + The axis to use. 0 or 'index' for row-wise, 1 or 'columns' for column-wise skipna : boolean, default True Exclude NA/null values. If an entire row/column is NA, the result will be NA. diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 152983451bc38..d146adb7eb260 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2559,10 +2559,10 @@ def to_msgpack(self, path_or_buf=None, encoding="utf-8", **kwargs): path : str, buffer-like, or None Destination for the serialized object. If None, return generated bytes - append : bool whether to append to an existing msgpack - (default is False) - compress : type of compressor (zlib or blosc), default to None (no - compression) + append : bool, default False + Whether to append to an existing msgpack. + compress : str, default None + Type of compressor (zlib, blosc or None). Returns ------- @@ -2797,8 +2797,8 @@ def to_clipboard(self, excel=True, sep=None, **kwargs): Parameters ---------- excel : bool, default True - - True, use the provided separator, writing in a csv format for - allowing easy pasting into excel. + Produce output in a csv format for easy pasting into excel. + - True, use the provided separator for csv pasting. - False, write a string representation of the object to the clipboard. @@ -5024,15 +5024,15 @@ def sample( Parameters ---------- func : function - function to apply to the %(klass)s. + Function to apply to the %(klass)s. ``args``, and ``kwargs`` are passed into ``func``. Alternatively a ``(callable, data_keyword)`` tuple where ``data_keyword`` is a string indicating the keyword of ``callable`` that expects the %(klass)s. args : iterable, optional - positional arguments passed into ``func``. + Positional arguments passed into ``func``. kwargs : mapping, optional - a dictionary of keyword arguments passed into ``func``. + A dictionary of keyword arguments passed into ``func``. Returns ------- diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index fe6b339c2f4c8..3288791763243 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -514,6 +514,8 @@ class PlotAccessor(PandasObject): Allows plotting of one column versus another. Only used if data is a DataFrame. kind : str + The kind of plot to produce: + - 'line' : line plot (default) - 'bar' : vertical bar plot - 'barh' : horizontal bar plot @@ -537,7 +539,7 @@ class PlotAccessor(PandasObject): legend : False/True/'reverse' Place legend on axis subplots style : list or dict - matplotlib line style per column + The matplotlib line style per column logx : bool or 'sym', default False Use log scaling or symlog scaling on x axis .. versionchanged:: 0.25.0 From 933bb533ad79b2e4a2a1f782b04981021121558f Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Fri, 27 Sep 2019 14:02:32 +0100 Subject: [PATCH 2/4] DOC: updated core.frame, core.generic and core.plotting._core for PR08 doc errors --- pandas/core/frame.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 3d2a9a4d3c5f5..47d7fb05df2cb 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -7562,7 +7562,8 @@ def corrwith(self, other, axis=0, drop=False, method="pearson"): other : DataFrame, Series Object with which to compute correlations. axis : {0 or 'index', 1 or 'columns'}, default 0 - The axis to use. 0 or 'index' to compute column-wise, 1 or 'columns' for row-wise. + The axis to use. 0 or 'index' to compute column-wise, 1 or 'columns' for + row-wise. drop : bool, default False Drop missing indices from result. method : {'pearson', 'kendall', 'spearman'} or callable From 9ea677d88bac4d8cca642790e48e5a2876a14ca4 Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Sat, 28 Sep 2019 16:46:44 +0100 Subject: [PATCH 3/4] DOC: GH28655 fixed typo and doc build errors in frame and generic --- pandas/core/frame.py | 9 ++++----- pandas/core/generic.py | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 47d7fb05df2cb..36b559ffb809a 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -4808,10 +4808,9 @@ def duplicated(self, subset=None, keep="first"): default use all of the columns keep : {'first', 'last', False}, default 'first' Determines which duplicates (if any) to mark. - - ``first`` : Mark duplicates as ``True`` except for the - first occurrence. - - ``last`` : Mark duplicates as ``True`` except for the - last occurrence. + + - ``first`` : Mark duplicates as ``True`` except for the first occurrence. + - ``last`` : Mark duplicates as ``True`` except for the last occurrence. - False : Mark all duplicates as ``True``. Returns @@ -6235,7 +6234,7 @@ def unstack(self, level=-1, fill_value=None): ---------- level : int, string, or list of these, default -1 (last level) Level(s) of index to unstack, can pass level name - fill_value : sint, string or dict + fill_value : int, string or dict Replace NaN with this value if the unstack produces missing values Returns diff --git a/pandas/core/generic.py b/pandas/core/generic.py index d146adb7eb260..8d63dfac33d17 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2798,9 +2798,9 @@ def to_clipboard(self, excel=True, sep=None, **kwargs): ---------- excel : bool, default True Produce output in a csv format for easy pasting into excel. + - True, use the provided separator for csv pasting. - - False, write a string representation of the object to the - clipboard. + - False, write a string representation of the object to the clipboard. sep : str, default ``'\t'`` Field delimiter. From 0ec90bffae53975ce09c8b8cddec97851bd55cd6 Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Sat, 28 Sep 2019 17:00:22 +0100 Subject: [PATCH 4/4] DOC: GH28655 fixed type in frame.py --- pandas/core/frame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 36b559ffb809a..209be8cdfb0ff 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -3461,7 +3461,7 @@ def insert(self, loc, column, value, allow_duplicates=False): ---------- loc : int Insertion index. Must verify 0 <= loc <= len(columns) - column : string, number, or hashable object + column : str, number, or hashable object Label of the inserted column. value : int, Series, or array-like allow_duplicates : bool, optional