From 41979a5a512fbcd55e9f144cbd5820c4adecbe69 Mon Sep 17 00:00:00 2001 From: Tola Alade Date: Sun, 22 Sep 2019 10:38:37 +0100 Subject: [PATCH 1/6] 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 2/6] 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 3/6] 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 4/6] 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 5/6] 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 6/6] 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')