From 41979a5a512fbcd55e9f144cbd5820c4adecbe69 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 22 Sep 2019 10:38:37 +0100 Subject: [PATCH 01/23] fixing parameter discrepency in pandas.DataFrame.plot.scatter --- pandas/plotting/_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index fe6b339c2f4c8..ddcf65cb59f3a 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -1404,7 +1404,7 @@ def scatter(self, x, y, s=None, c=None, **kwargs): - A column name or position whose values will be used to color the marker points according to a colormap. - **kwds + **kwargs Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns From a2bd9a1d525c34acc42326d07dc6c5a734cf0c3f Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 22 Sep 2019 10:59:49 +0100 Subject: [PATCH 02/23] updated **kwds to **kwargs --- pandas/plotting/_core.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index ddcf65cb59f3a..07726c3d25abc 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -810,7 +810,7 @@ def line(self, x=None, y=None, **kwargs): The values to be plotted. Either the location or the label of the columns to be used. By default, it will use the remaining DataFrame numeric columns. - **kwds + **kwargs Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns @@ -880,7 +880,7 @@ def bar(self, x=None, y=None, **kwargs): y : label or position, optional Allows plotting of one column versus another. If not specified, all numerical columns are used. - **kwds + **kwargs Additional keyword arguments are documented in :meth:`DataFrame.plot`. @@ -963,7 +963,7 @@ def barh(self, x=None, y=None, **kwargs): Column to be used for categories. y : label or position, default All numeric columns in dataframe Columns to be plotted from the DataFrame. - **kwds + **kwargs Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns @@ -1049,7 +1049,7 @@ def box(self, by=None, **kwargs): ---------- by : str or sequence Column in the DataFrame to group by. - **kwds : optional + **kwargs : optional Additional keywords are documented in :meth:`DataFrame.plot`. @@ -1092,7 +1092,7 @@ def hist(self, by=None, bins=10, **kwargs): Column in the DataFrame to group by. bins : int, default 10 Number of histogram bins to be used. - **kwds + **kwargs Additional keyword arguments are documented in :meth:`DataFrame.plot`. @@ -1148,7 +1148,7 @@ def kde(self, bw_method=None, ind=None, **kwargs): 1000 equally spaced points are used. If `ind` is a NumPy array, the KDE is evaluated at the points passed. If `ind` is an integer, `ind` number of equally spaced points are used. - **kwds : optional + **kwargs : optional Additional keyword arguments are documented in :meth:`pandas.%(this-datatype)s.plot`. @@ -1322,7 +1322,7 @@ def pie(self, **kwargs): y : int or label, optional Label or position of the column to plot. If not provided, ``subplots=True`` argument must be passed. - **kwds + **kwargs Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns @@ -1476,7 +1476,7 @@ def hexbin(self, x, y, C=None, reduce_C_function=None, gridsize=None, **kwargs): Alternatively, gridsize can be a tuple with two elements specifying the number of hexagons in the x-direction and the y-direction. - **kwds + **kwargs Additional keyword arguments are documented in :meth:`DataFrame.plot`. From 8136c0ecf556a07c2ae5a7630947d3de2c0150b9 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Mon, 23 Sep 2019 20:32:04 +0100 Subject: [PATCH 03/23] updating **kwargs optional to **kwargs --- pandas/plotting/_core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 07726c3d25abc..45876c8e24be5 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -1049,7 +1049,7 @@ def box(self, by=None, **kwargs): ---------- by : str or sequence Column in the DataFrame to group by. - **kwargs : optional + **kwargs Additional keywords are documented in :meth:`DataFrame.plot`. @@ -1148,7 +1148,7 @@ def kde(self, bw_method=None, ind=None, **kwargs): 1000 equally spaced points are used. If `ind` is a NumPy array, the KDE is evaluated at the points passed. If `ind` is an integer, `ind` number of equally spaced points are used. - **kwargs : optional + **kwargs Additional keyword arguments are documented in :meth:`pandas.%(this-datatype)s.plot`. @@ -1250,7 +1250,7 @@ def area(self, x=None, y=None, **kwargs): stacked : bool, default True Area plots are stacked by default. Set to False to create a unstacked plot. - **kwds : optional + **kwargs Additional keyword arguments are documented in :meth:`DataFrame.plot`. From 78419d0bd349f60446c70b89db0b2dd13f603507 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Mon, 23 Sep 2019 20:39:20 +0100 Subject: [PATCH 04/23] updating the other **kwds to **kwargs to keep things consistent in the _core.py file --- pandas/plotting/_core.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 45876c8e24be5..af63396fc4c9e 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -28,7 +28,7 @@ def hist_series( yrot=None, figsize=None, bins=10, - **kwds + **kwargs ): """ Draw histogram of the input series using matplotlib. @@ -56,7 +56,7 @@ def hist_series( bin edges are calculated and returned. If bins is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, bins is returned unmodified. - `**kwds` : keywords + `**kwargs To be passed to the actual plotting function Returns @@ -80,7 +80,7 @@ def hist_series( yrot=yrot, figsize=figsize, bins=bins, - **kwds + **kwargs ) @@ -99,7 +99,7 @@ def hist_frame( figsize=None, layout=None, bins=10, - **kwds + **kwargs ): """ Make a histogram of the DataFrame's. @@ -151,7 +151,7 @@ def hist_frame( bin edges are calculated and returned. If bins is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, bins is returned unmodified. - **kwds + **kwargs All other plotting keyword arguments to be passed to :meth:`matplotlib.pyplot.hist`. @@ -194,7 +194,7 @@ def hist_frame( figsize=figsize, layout=layout, bins=bins, - **kwds + **kwargs ) @@ -209,7 +209,7 @@ def boxplot( figsize=None, layout=None, return_type=None, - **kwds + **kwargs ): """ Make a box plot from DataFrame columns. @@ -260,7 +260,7 @@ def boxplot( If ``return_type`` is `None`, a NumPy array of axes with the same shape as ``layout`` is returned. - **kwds + **kwargs All other plotting keyword arguments to be passed to :func:`matplotlib.pyplot.boxplot`. @@ -385,7 +385,7 @@ def boxplot( figsize=figsize, layout=layout, return_type=return_type, - **kwds + **kwargs ) @@ -401,7 +401,7 @@ def boxplot_frame( figsize=None, layout=None, return_type=None, - **kwds + **kwargs ): plot_backend = _get_plot_backend() return plot_backend.boxplot_frame( @@ -415,7 +415,7 @@ def boxplot_frame( figsize=figsize, layout=layout, return_type=return_type, - **kwds + **kwargs ) @@ -431,7 +431,7 @@ def boxplot_frame_groupby( layout=None, sharex=False, sharey=True, - **kwds + **kwargs ): """ Make box plots from DataFrameGroupBy data. @@ -459,7 +459,7 @@ def boxplot_frame_groupby( Whether y-axes will be shared among subplots .. versionadded:: 0.23.1 - `**kwds` : Keyword Arguments + `**kwargs All other plotting keyword arguments to be passed to matplotlib's boxplot function @@ -495,7 +495,7 @@ def boxplot_frame_groupby( layout=layout, sharex=sharex, sharey=sharey, - **kwds + **kwargs ) @@ -586,7 +586,7 @@ class PlotAccessor(PandasObject): labels with "(right)" in the legend include_bool : bool, default is False If True, boolean values can be plotted. - `**kwds` : keywords + `**kwargs Options to pass to matplotlib plotting method. Returns From 60151af6ceca6ee1392f9047621522ed04c06a4b Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Tue, 24 Sep 2019 18:57:28 +0100 Subject: [PATCH 05/23] removed " before **kwargs' --- pandas/plotting/_core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index af63396fc4c9e..8724382d9ec55 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -56,7 +56,7 @@ def hist_series( bin edges are calculated and returned. If bins is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, bins is returned unmodified. - `**kwargs + **kwargs To be passed to the actual plotting function Returns @@ -459,7 +459,7 @@ def boxplot_frame_groupby( Whether y-axes will be shared among subplots .. versionadded:: 0.23.1 - `**kwargs + **kwargs All other plotting keyword arguments to be passed to matplotlib's boxplot function @@ -586,7 +586,7 @@ class PlotAccessor(PandasObject): labels with "(right)" in the legend include_bool : bool, default is False If True, boolean values can be plotted. - `**kwargs + **kwargs Options to pass to matplotlib plotting method. Returns From 6ca5b7a88cd38a2d367ce118b2f952e381af8af5 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Tue, 24 Sep 2019 19:34:20 +0100 Subject: [PATCH 06/23] splitting comment in test_sort over multiple lines as it is causing the CI to fail --- pandas/tests/groupby/test_categorical.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/tests/groupby/test_categorical.py b/pandas/tests/groupby/test_categorical.py index e09af3fd48ee6..1fd7b1f583049 100644 --- a/pandas/tests/groupby/test_categorical.py +++ b/pandas/tests/groupby/test_categorical.py @@ -782,7 +782,9 @@ def test_categorical_no_compress(): def test_sort(): - # http://stackoverflow.com/questions/23814368/sorting-pandas-categorical-labels-after-groupby # noqa: flake8 + # http://stackoverflow.com/questions/23814368/ + # sorting-pandas-categorical-labels-after-groupby + # noqa: flake8 # This should result in a properly sorted Series so that the plot # has a sorted x axis # self.cat.groupby(['value_group'])['value_group'].count().plot(kind='bar') From b5692e05189da3721b73c8390b056d31a4b7a7ed Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 16:57:47 +0100 Subject: [PATCH 07/23] changing pandas.dataframe methods from boolean to bool --- pandas/core/frame.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index ed05691d33d07..b6bc87165b542 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -322,7 +322,7 @@ class DataFrame(NDFrame): RangeIndex (0, 1, 2, ..., n) if no column labels are provided dtype : dtype, default None Data type to force. Only a single dtype is allowed. If None, infer - copy : boolean, default False + copy : bool, default False Copy data from inputs. Only affects DataFrame / 2d ndarray input See Also @@ -1553,7 +1553,7 @@ def from_records( columns. Otherwise this argument indicates the order of the columns in the result (any names not found in the data will become all-NA columns) - coerce_float : boolean, default False + coerce_float : bool, default False Attempt to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point, useful for SQL result sets nrows : int, default None @@ -4775,7 +4775,7 @@ def drop_duplicates(self, subset=None, keep="first", inplace=False): - ``first`` : Drop duplicates except for the first occurrence. - ``last`` : Drop duplicates except for the last occurrence. - False : Drop all duplicates. - inplace : boolean, default False + inplace : bool, default False Whether to drop duplicates in place or to return a copy Returns @@ -5850,14 +5850,14 @@ def pivot(self, index=None, columns=None, values=None): is function or list of functions fill_value : scalar, default None Value to replace missing values with - margins : boolean, default False + margins : bool, default False Add all row / columns (e.g. for subtotal / grand totals) - dropna : boolean, default True + dropna : bool, default True Do not include columns whose entries are all NaN margins_name : string, default 'All' Name of the row / column that will contain the totals when margins is True. - observed : boolean, default False + observed : bool, default False This only applies if any of the groupers are Categoricals. If True: only show observed values for categorical groupers. If False: show all values for categorical groupers. @@ -6894,11 +6894,11 @@ def append(self, other, ignore_index=False, verify_integrity=False, sort=None): ---------- other : DataFrame or Series/dict-like object, or list of these The data to append. - ignore_index : boolean, default False + ignore_index : bool, default False If True, do not use the index labels. - verify_integrity : boolean, default False + verify_integrity : bool, default False If True, raise ValueError on creating index with duplicates. - sort : boolean, default None + sort : bool, default None Sort columns if the columns of `self` and `other` are not aligned. The default sorting is deprecated and will change to not-sorting in a future version of pandas. Explicitly pass ``sort=True`` to @@ -7940,7 +7940,7 @@ def idxmin(self, axis=0, skipna=True): ---------- axis : {0 or 'index', 1 or 'columns'}, default 0 0 or 'index' for row-wise, 1 or 'columns' for column-wise - skipna : boolean, default True + skipna : bool, default True Exclude NA/null values. If an entire row/column is NA, the result will be NA. @@ -7977,7 +7977,7 @@ def idxmax(self, axis=0, skipna=True): ---------- axis : {0 or 'index', 1 or 'columns'}, default 0 0 or 'index' for row-wise, 1 or 'columns' for column-wise - skipna : boolean, default True + skipna : bool, default True Exclude NA/null values. If an entire row/column is NA, the result will be NA. From d20973e68549e924be866fb91286b654e7133f5c Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 17:02:49 +0100 Subject: [PATCH 08/23] changing pandas.dataframe methods from boolean to bool --- pandas/core/frame.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index b6bc87165b542..a5cfcd6ccc99d 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1542,7 +1542,7 @@ def from_records( Parameters ---------- data : ndarray (structured dtype), list of tuples, dict, or DataFrame - index : string, list of fields, array-like + index : str, list of fields, array-like Field of array to use as the index, alternately a specific set of input labels to use exclude : sequence, default None @@ -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 @@ -5197,7 +5197,7 @@ def swaplevel(self, i=-2, j=-1, axis=0): Parameters ---------- - i, j : int, string (can be mixed) + i, j : int, str (can be mixed) Level of index to be swapped. Can pass level name as string. Returns @@ -5723,12 +5723,12 @@ def update( Parameters ----------%s - index : string or object, optional + index : str or object, optional Column to use to make new frame's index. If None, uses existing index. - columns : string or object + columns : str or object Column to use to make new frame's columns. - values : string, object or a list of the previous, optional + values : str, object or a list of the previous, optional Column(s) to use for populating new frame's values. If not specified, all remaining columns will be used and the result will have hierarchically indexed columns. @@ -6231,7 +6231,7 @@ def unstack(self, level=-1, fill_value=None): Parameters ---------- - level : int, string, or list of these, default -1 (last level) + level : int, str, 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 @@ -6305,7 +6305,7 @@ def unstack(self, level=-1, fill_value=None): ``frame.columns.name`` or 'variable'. value_name : scalar, default 'value' Name to use for the 'value' column. - col_level : int or string, optional + col_level : int or str, optional If columns are a MultiIndex then use this level to melt. Returns From 32f06b98288e52b35e8ee007c0535925c29eff0d Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 17:04:32 +0100 Subject: [PATCH 09/23] Revert "changing pandas.dataframe methods from boolean to bool" This reverts commit d20973e68549e924be866fb91286b654e7133f5c. --- pandas/core/frame.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index a5cfcd6ccc99d..b6bc87165b542 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1542,7 +1542,7 @@ def from_records( Parameters ---------- data : ndarray (structured dtype), list of tuples, dict, or DataFrame - index : str, list of fields, array-like + index : string, list of fields, array-like Field of array to use as the index, alternately a specific set of input labels to use exclude : sequence, default None @@ -3461,7 +3461,7 @@ def insert(self, loc, column, value, allow_duplicates=False): ---------- loc : int Insertion index. Must verify 0 <= loc <= len(columns) - column : str, number, or hashable object + column : string, number, or hashable object label of the inserted column value : int, Series, or array-like allow_duplicates : bool, optional @@ -5197,7 +5197,7 @@ def swaplevel(self, i=-2, j=-1, axis=0): Parameters ---------- - i, j : int, str (can be mixed) + i, j : int, string (can be mixed) Level of index to be swapped. Can pass level name as string. Returns @@ -5723,12 +5723,12 @@ def update( Parameters ----------%s - index : str or object, optional + index : string or object, optional Column to use to make new frame's index. If None, uses existing index. - columns : str or object + columns : string or object Column to use to make new frame's columns. - values : str, object or a list of the previous, optional + values : string, object or a list of the previous, optional Column(s) to use for populating new frame's values. If not specified, all remaining columns will be used and the result will have hierarchically indexed columns. @@ -6231,7 +6231,7 @@ def unstack(self, level=-1, fill_value=None): Parameters ---------- - level : int, str, or list of these, default -1 (last level) + 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 @@ -6305,7 +6305,7 @@ def unstack(self, level=-1, fill_value=None): ``frame.columns.name`` or 'variable'. value_name : scalar, default 'value' Name to use for the 'value' column. - col_level : int or str, optional + col_level : int or string, optional If columns are a MultiIndex then use this level to melt. Returns From 40424559f5d02da0e550b154ec33e48f78b5a50d Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 17:11:56 +0100 Subject: [PATCH 10/23] changing pandas.dataframe methods from string to str --- pandas/core/frame.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index b6bc87165b542..fe6d487185078 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1542,7 +1542,7 @@ def from_records( Parameters ---------- data : ndarray (structured dtype), list of tuples, dict, or DataFrame - index : string, list of fields, array-like + index : str, list of fields, array-like Field of array to use as the index, alternately a specific set of input labels to use exclude : sequence, default None @@ -5197,7 +5197,7 @@ def swaplevel(self, i=-2, j=-1, axis=0): Parameters ---------- - i, j : int, string (can be mixed) + i, j : int, str (can be mixed) Level of index to be swapped. Can pass level name as string. Returns @@ -5723,12 +5723,12 @@ def update( Parameters ----------%s - index : string or object, optional + index : str or object, optional Column to use to make new frame's index. If None, uses existing index. - columns : string or object + columns : str or object Column to use to make new frame's columns. - values : string, object or a list of the previous, optional + values : str, object or a list of the previous, optional Column(s) to use for populating new frame's values. If not specified, all remaining columns will be used and the result will have hierarchically indexed columns. @@ -5854,7 +5854,7 @@ def pivot(self, index=None, columns=None, values=None): Add all row / columns (e.g. for subtotal / grand totals) dropna : bool, default True Do not include columns whose entries are all NaN - margins_name : string, default 'All' + margins_name : str, default 'All' Name of the row / column that will contain the totals when margins is True. observed : bool, default False @@ -6231,7 +6231,7 @@ def unstack(self, level=-1, fill_value=None): Parameters ---------- - level : int, string, or list of these, default -1 (last level) + level : int, str, 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 @@ -6305,7 +6305,7 @@ def unstack(self, level=-1, fill_value=None): ``frame.columns.name`` or 'variable'. value_name : scalar, default 'value' Name to use for the 'value' column. - col_level : int or string, optional + col_level : int or str, optional If columns are a MultiIndex then use this level to melt. Returns From 46d9d312555fa8d01aff0b334d61acb9e3c2ddc6 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 17:14:25 +0100 Subject: [PATCH 11/23] changing pandas.dataframe.insert from string to str --- 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 fe6d487185078..e4a44a89998e3 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 From 400430e2fc8999616fc62eeb69c7fbbd8b92b6ab Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 17:23:19 +0100 Subject: [PATCH 12/23] changing pandas.groupby methods from boolean to bool --- pandas/core/groupby/groupby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index e010e615e176e..2e075f3d5d2dc 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -2099,13 +2099,13 @@ def rank( * max: highest rank in group * first: ranks assigned in order they appear in the array * dense: like 'min', but rank always increases by 1 between groups - ascending : boolean, default True + ascending : bool, default True False for ranks by high (1) to low (N) na_option : {'keep', 'top', 'bottom'}, default 'keep' * keep: leave NA values where they are * top: smallest rank if ascending * bottom: smallest rank if descending - pct : boolean, default False + pct : bool, default False Compute percentage rank of data within each group axis : int, default 0 The axis of the object over which to compute the rank. From 0ebb04b9865cbf472db5e8fb0e6cec94c67ebf28 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 17:24:21 +0100 Subject: [PATCH 13/23] changing pandas.groupby methods from integer to int --- pandas/core/groupby/groupby.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 2e075f3d5d2dc..7912d35d2043e 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -1253,7 +1253,7 @@ def std(self, ddof=1, *args, **kwargs): Parameters ---------- - ddof : integer, default 1 + ddof : int, default 1 degrees of freedom Returns @@ -1276,7 +1276,7 @@ def var(self, ddof=1, *args, **kwargs): Parameters ---------- - ddof : integer, default 1 + ddof : int, default 1 degrees of freedom Returns @@ -1311,7 +1311,7 @@ def sem(self, ddof=1): Parameters ---------- - ddof : integer, default 1 + ddof : int, default 1 degrees of freedom Returns @@ -1623,7 +1623,7 @@ def pad(self, limit=None): Parameters ---------- - limit : integer, optional + limit : int, optional limit of how many values to fill Returns @@ -1649,7 +1649,7 @@ def backfill(self, limit=None): Parameters ---------- - limit : integer, optional + limit : int, optional limit of how many values to fill Returns @@ -2313,7 +2313,7 @@ def shift(self, periods=1, freq=None, axis=0, fill_value=None): Parameters ---------- - periods : integer, default 1 + periods : int, default 1 number of periods to shift freq : frequency string axis : axis to shift, default 0 From 5dcceb222da8725f2375271b6c9ed66a7a5f8bad Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 17:25:11 +0100 Subject: [PATCH 14/23] changing pandas.groupby methods from string to str --- pandas/core/groupby/groupby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 7912d35d2043e..6facbe7e01c57 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -1032,7 +1032,7 @@ class GroupBy(_GroupBy): Most users should ignore this exclusions : array-like, optional List of columns to exclude - name : string + name : str Most users should ignore this Returns From 69a91a4c502c80a1b49c3769b3a306e140c81695 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 18:54:33 +0100 Subject: [PATCH 15/23] changing pandas.grouper docstring from boolean to bool and string to str --- pandas/core/groupby/grouper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/groupby/grouper.py b/pandas/core/groupby/grouper.py index 2ebfbed0b132a..2d37121d28308 100644 --- a/pandas/core/groupby/grouper.py +++ b/pandas/core/groupby/grouper.py @@ -48,17 +48,17 @@ class Grouper: Parameters ---------- - key : string, defaults to None + key : str, defaults to None groupby key, which selects the grouping column of the target level : name/number, defaults to None the level for the target index - freq : string / frequency object, defaults to None + freq : str / frequency object, defaults to None This will groupby the specified frequency if the target selection (via key or level) is a datetime-like object. For full specification of available frequencies, please see `here `_. axis : number/name of the axis, defaults to 0 - sort : boolean, default to False + sort : bool, default to False whether to sort the resulting labels closed : {'left' or 'right'} Closed end of interval. Only when `freq` parameter is passed. @@ -69,7 +69,7 @@ class Grouper: If grouper is PeriodIndex and `freq` parameter is passed. base : int, default 0 Only when `freq` parameter is passed. - loffset : string, DateOffset, timedelta object + loffset : str, DateOffset, timedelta object Only when `freq` parameter is passed. Returns From 3aa3057f76b03b3cf0216dd9a3f44414e3590e7a Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 19:02:03 +0100 Subject: [PATCH 16/23] changing pandas.datetimeindex methods docstring from boolean to bool --- pandas/core/indexes/datetimes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index cce390d98c037..db05be9591bbd 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -106,7 +106,7 @@ class DatetimeIndex(DatetimeIndexOpsMixin, Int64Index, DatetimeDelegateMixin): Optional datetime-like data to construct index with copy : bool Make a copy of input ndarray - freq : string or pandas offset object, optional + freq : str or pandas offset object, optional One of pandas date offset strings or corresponding objects. The string 'infer' can be passed in order to set the frequency of the index as the inferred frequency upon creation @@ -129,7 +129,7 @@ class DatetimeIndex(DatetimeIndexOpsMixin, Int64Index, DatetimeDelegateMixin): .. deprecated:: 0.24.0 - closed : string or None, default None + closed : str or None, default None Make the interval closed with respect to the given frequency to the 'left', 'right', or both sides (None) @@ -1371,8 +1371,8 @@ def indexer_between_time( datetime.time or string in appropriate format ("%H:%M", "%H%M", "%I:%M%p", "%I%M%p", "%H:%M:%S", "%H%M%S", "%I:%M:%S%p", "%I%M%S%p"). - include_start : boolean, default True - include_end : boolean, default True + include_start : bool, default True + include_end : bool, default True Returns ------- From 6c49a81c808d923e74df3cf1ddaaf7ea0a2537e6 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 19:06:23 +0100 Subject: [PATCH 17/23] changing pandas.read_sas docstring from string to str --- pandas/io/sas/sasreader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/io/sas/sasreader.py b/pandas/io/sas/sasreader.py index 571c544d48b29..6bd3532d538c7 100644 --- a/pandas/io/sas/sasreader.py +++ b/pandas/io/sas/sasreader.py @@ -29,12 +29,12 @@ def read_sas( By file-like object, we refer to objects with a ``read()`` method, such as a file handler (e.g. via builtin ``open`` function) or ``StringIO``. - format : string {'xport', 'sas7bdat'} or None + format : str {'xport', 'sas7bdat'} or None If None, file format is inferred from file extension. If 'xport' or 'sas7bdat', uses the corresponding format. index : identifier of index column, defaults to None Identifier of column that should be used as index of the DataFrame. - encoding : string, default is None + encoding : str, default is None Encoding for text data. If None, text data are stored as raw bytes. chunksize : int Read file `chunksize` lines at a time, returns iterator. From b0c09b4a3d66db09d15be10c47c94d314c3e480d Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 19:59:49 +0100 Subject: [PATCH 18/23] fixing parameter type inconsistencies for pandas.bdate_range --- pandas/core/indexes/datetimes.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index db05be9591bbd..ece2b352907dd 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -1598,22 +1598,22 @@ def bdate_range( Parameters ---------- - start : string or datetime-like, default None + start : str or datetime-like, default None Left bound for generating dates. - end : string or datetime-like, default None + end : str or datetime-like, default None Right bound for generating dates. - periods : integer, default None + periods : int, default None Number of periods to generate. - freq : string or DateOffset, default 'B' (business daily) + freq : str or DateOffset, default 'B' (business daily) Frequency strings can have multiples, e.g. '5H'. - tz : string or None + tz : str or None Time zone name for returning localized DatetimeIndex, for example Asia/Beijing. normalize : bool, default False Normalize start/end dates to midnight before generating date range. - name : string, default None + name : str, default None Name of the resulting DatetimeIndex. - weekmask : string or None, default None + weekmask : str or None, default None Weekmask of valid business days, passed to ``numpy.busdaycalendar``, only used when custom frequency strings are passed. The default value None is equivalent to 'Mon Tue Wed Thu Fri'. @@ -1627,7 +1627,7 @@ def bdate_range( .. versionadded:: 0.21.0 - closed : string, default None + closed : str, default None Make the interval closed with respect to the given frequency to the 'left', 'right', or both sides (None). **kwargs From ff13a6991d12d8c542376cf9537704f55baad129 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 20:04:28 +0100 Subject: [PATCH 19/23] fixing parameter type inconsistencies for pandas.to_datetim --- pandas/core/tools/datetimes.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index b07647cf5b5fb..32dc3c1f3e8f2 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -577,7 +577,7 @@ def to_datetime( Parameters ---------- - arg : integer, float, string, datetime, list, tuple, 1-d array, Series + arg : int, float, str, datetime, list, tuple, 1-d array, Series or DataFrame/dict-like errors : {'ignore', 'raise', 'coerce'}, default 'raise' @@ -585,13 +585,13 @@ def to_datetime( - If 'raise', then invalid parsing will raise an exception - If 'coerce', then invalid parsing will be set as NaT - If 'ignore', then invalid parsing will return the input - dayfirst : boolean, default False + dayfirst : bool, default False Specify a date parse order if `arg` is str or its list-likes. If True, parses dates with the day first, eg 10/11/12 is parsed as 2012-11-10. Warning: dayfirst=True is not strict, but will prefer to parse with day first (this is a known bug, based on dateutil behavior). - yearfirst : boolean, default False + yearfirst : bool, default False Specify a date parse order if `arg` is str or its list-likes. - If True parses dates with the year first, eg 10/11/12 is parsed as @@ -604,10 +604,10 @@ def to_datetime( .. versionadded:: 0.16.1 - utc : boolean, default None + utc : bool, default None Return UTC DatetimeIndex if True (converting any tz-aware datetime.datetime objects as well). - box : boolean, default True + box : bool, default True - If True returns a DatetimeIndex or Index-like object - If False returns ndarray of values. @@ -617,22 +617,22 @@ def to_datetime( instead to get an ndarray of values or numpy.datetime64, respectively. - format : string, default None + format : str, default None strftime to parse time, eg "%d/%m/%Y", note that "%f" will parse all the way up to nanoseconds. See strftime documentation for more information on choices: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior - exact : boolean, True by default + exact : bool, True by default - If True, require an exact format match. - If False, allow the format to match anywhere in the target string. - unit : string, default 'ns' + unit : str, default 'ns' unit of the arg (D,s,ms,us,ns) denote the unit, which is an integer or float number. This will be based off the origin. Example, with unit='ms' and origin='unix' (the default), this would calculate the number of milliseconds to the unix epoch start. - infer_datetime_format : boolean, default False + infer_datetime_format : bool, default False If True and no `format` is given, attempt to infer the format of the datetime strings, and if it can be inferred, switch to a faster method of parsing them. In some cases this can increase the parsing @@ -649,7 +649,7 @@ def to_datetime( origin. .. versionadded:: 0.20.0 - cache : boolean, default True + cache : bool, default True If True, use a cache of unique, converted dates to apply the datetime conversion. May produce significant speed-up when parsing duplicate date strings, especially ones with timezone offsets. From 4ef0b642ada3daac9b964b5b2ce4c4736210591f Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 20:07:56 +0100 Subject: [PATCH 20/23] fixing parameter type inconsistencies for pandas.date_range --- pandas/core/indexes/datetimes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index ece2b352907dd..0b20df38e7d42 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -1435,7 +1435,7 @@ def date_range( Left bound for generating dates. end : str or datetime-like, optional Right bound for generating dates. - periods : integer, optional + periods : int, optional Number of periods to generate. freq : str or DateOffset, default 'D' Frequency strings can have multiples, e.g. '5H'. See From 42f273410abd888e9822e1902c73d793d017b2ce Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 20:13:37 +0100 Subject: [PATCH 21/23] changing pandas.index methods docstring from string to str --- pandas/core/indexes/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 62662edb692a7..bb060c76fec70 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -904,7 +904,7 @@ def repeat(self, repeats, axis=None): Parameters ---------- - name : string, optional + name : str, optional deep : boolean, default False dtype : numpy dtype or pandas type @@ -1172,7 +1172,7 @@ def to_series(self, index=None, name=None): ---------- index : Index, optional index of resulting Series. If None, defaults to original index - name : string, optional + name : str, optional name of resulting Series. If None, defaults to name of original index @@ -4924,7 +4924,7 @@ def slice_indexer(self, start=None, end=None, step=None, kind=None): end : label, default None If None, defaults to the end step : int, default None - kind : string, default None + kind : str, default None Returns ------- From d57f6672aad0f49339177f0728025ebfc3c4acdb Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 20:16:15 +0100 Subject: [PATCH 22/23] changing pandas.index methods docstring from boolean to bool --- pandas/core/indexes/base.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index bb060c76fec70..0b633602f3ed0 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -905,7 +905,7 @@ def repeat(self, repeats, axis=None): Parameters ---------- name : str, optional - deep : boolean, default False + deep : bool, default False dtype : numpy dtype or pandas type Returns @@ -1198,7 +1198,7 @@ def to_frame(self, index=True, name=None): Parameters ---------- - index : boolean, default True + index : bool, default True Set the index of the returned DataFrame as the original Index. name : object, default None @@ -1401,7 +1401,7 @@ def rename(self, name, inplace=False): ---------- name : label or list of labels Name(s) to set. - inplace : boolean, default False + inplace : bool, default False Modifies the object directly, instead of creating a new Index or MultiIndex. @@ -1494,7 +1494,7 @@ def sortlevel(self, level=None, ascending=True, sort_remaining=None): Parameters ---------- - ascending : boolean, default True + ascending : bool, default True False to sort in descending order level, sort_remaining are compat parameters @@ -3415,8 +3415,8 @@ def _reindex_non_unique(self, target): other : Index how : {'left', 'right', 'inner', 'outer'} level : int or level name, default None - return_indexers : boolean, default False - sort : boolean, default False + return_indexers : bool, default False + sort : bool, default False Sort the join keys lexicographically in the result Index. If False, the order of the join keys depends on the join type (how keyword) @@ -3942,7 +3942,7 @@ def memory_usage(self, deep=False): Parameters ---------- - cond : boolean array-like with the same length as self + cond : bool array-like with the same length as self other : scalar, or array-like Returns From 0bb2b544cb20d13611b419bf0c677cbb757d24c3 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Thu, 26 Sep 2019 20:27:30 +0100 Subject: [PATCH 23/23] changing pandas.resampler methods docstring from integer to int --- pandas/core/resample.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/core/resample.py b/pandas/core/resample.py index a5d0e2cb3b58f..545bc21dd6d1b 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -423,7 +423,7 @@ def pad(self, limit=None): Parameters ---------- - limit : integer, optional + limit : int, optional limit of how many values to fill Returns @@ -514,7 +514,7 @@ def backfill(self, limit=None): Parameters ---------- - limit : integer, optional + limit : int, optional Limit of how many values to fill. Returns @@ -628,7 +628,7 @@ def fillna(self, method, limit=None): * 'backfill' or 'bfill': use next valid observation to fill gap. * 'nearest': use nearest valid observation to fill gap. - limit : integer, optional + limit : int, optional Limit of how many consecutive missing values to fill. Returns @@ -823,7 +823,7 @@ def std(self, ddof=1, *args, **kwargs): Parameters ---------- - ddof : integer, default 1 + ddof : int, default 1 Degrees of freedom. Returns @@ -840,7 +840,7 @@ def var(self, ddof=1, *args, **kwargs): Parameters ---------- - ddof : integer, default 1 + ddof : int, default 1 degrees of freedom Returns