From 50c5555943d3ba58d374dfd63b87450432d7a980 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Mon, 17 Aug 2020 20:08:04 -0500 Subject: [PATCH 1/6] CI: unpin numpy and matplotlib #35779 --- environment.yml | 5 ++--- requirements-dev.txt | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/environment.yml b/environment.yml index 1e51470d43d36..aaabf09b8f190 100644 --- a/environment.yml +++ b/environment.yml @@ -3,8 +3,7 @@ channels: - conda-forge dependencies: # required - # Pin numpy<1.19 until MPL 3.3.0 is released. - - numpy>=1.16.5,<1.19.0 + - numpy>=1.16.5 - python=3 - python-dateutil>=2.7.3 - pytz @@ -73,7 +72,7 @@ dependencies: - ipykernel - ipython>=7.11.1 - jinja2 # pandas.Styler - - matplotlib>=2.2.2,<3.3.0 # pandas.plotting, Series.plot, DataFrame.plot + - matplotlib>=2.2.2 # pandas.plotting, Series.plot, DataFrame.plot - numexpr>=2.6.8 - scipy>=1.2 - numba>=0.46.0 diff --git a/requirements-dev.txt b/requirements-dev.txt index 66e72641cd5bb..3d0778b74ccbd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # This file is auto-generated from environment.yml, do not modify. # See that file for comments about the need/usage of each dependency. -numpy>=1.16.5,<1.19.0 +numpy>=1.16.5 python-dateutil>=2.7.3 pytz asv @@ -47,7 +47,7 @@ bottleneck>=1.2.1 ipykernel ipython>=7.11.1 jinja2 -matplotlib>=2.2.2,<3.3.0 +matplotlib>=2.2.2 numexpr>=2.6.8 scipy>=1.2 numba>=0.46.0 From d245a957feccf1b8e5b9306b362a359a4fefa227 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Mon, 17 Aug 2020 21:03:18 -0500 Subject: [PATCH 2/6] fix memory usage output in doc --- pandas/core/frame.py | 2 +- pandas/core/series.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 1587dd8798ec3..c16919e523264 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -2600,7 +2600,7 @@ def to_html( 1 column_2 1000000 non-null object 2 column_3 1000000 non-null object dtypes: object(3) - memory usage: 188.8 MB""" + memory usage: 165.9 MB""" ), see_also_sub=( """ diff --git a/pandas/core/series.py b/pandas/core/series.py index e8bf87a39b572..cd2db659fbd0e 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -4637,7 +4637,7 @@ def memory_usage(self, index=True, deep=False): >>> s.memory_usage() 144 >>> s.memory_usage(deep=True) - 260 + 244 """ v = super().memory_usage(deep=deep) if index: From 16f73a45b6a8e4bacd2a434d71d6908dcb7d6ea7 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Tue, 18 Aug 2020 07:00:14 -0500 Subject: [PATCH 3/6] fix DeprecationWarning --- pandas/plotting/_matplotlib/boxplot.py | 2 +- pandas/plotting/_matplotlib/core.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/plotting/_matplotlib/boxplot.py b/pandas/plotting/_matplotlib/boxplot.py index 53ef97bbe9a72..b33daf39de37c 100644 --- a/pandas/plotting/_matplotlib/boxplot.py +++ b/pandas/plotting/_matplotlib/boxplot.py @@ -294,7 +294,7 @@ def maybe_color_bp(bp, **kwds): def plot_group(keys, values, ax): keys = [pprint_thing(x) for x in keys] - values = [np.asarray(remove_na_arraylike(v)) for v in values] + values = [np.asarray(remove_na_arraylike(v), dtype=object) for v in values] bp = ax.boxplot(values, **kwds) if fontsize is not None: ax.tick_params(axis="both", labelsize=fontsize) diff --git a/pandas/plotting/_matplotlib/core.py b/pandas/plotting/_matplotlib/core.py index b490e07e43753..8de73b15cd997 100644 --- a/pandas/plotting/_matplotlib/core.py +++ b/pandas/plotting/_matplotlib/core.py @@ -77,6 +77,7 @@ def _kind(self): "loglog": False, "mark_right": True, "stacked": False, + "normalize": False } def __init__( From de5e5fbd6799fafd1ef19390d38034c16a683e38 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Tue, 18 Aug 2020 11:16:39 -0500 Subject: [PATCH 4/6] set normalize to False --- pandas/plotting/_matplotlib/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/plotting/_matplotlib/core.py b/pandas/plotting/_matplotlib/core.py index 8de73b15cd997..7b6f5bfa692e3 100644 --- a/pandas/plotting/_matplotlib/core.py +++ b/pandas/plotting/_matplotlib/core.py @@ -77,7 +77,6 @@ def _kind(self): "loglog": False, "mark_right": True, "stacked": False, - "normalize": False } def __init__( @@ -1521,6 +1520,7 @@ def _validate_color_args(self): def _make_plot(self): colors = self._get_colors(num_colors=len(self.data), color_kwds="colors") self.kwds.setdefault("colors", colors) + self.kwds.setdefault("normalize", False) for i, (label, y) in enumerate(self._iter_data()): ax = self._get_ax(i) From 35c0dbf20f33aacff9021732d610bf7e268371b2 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Tue, 18 Aug 2020 12:08:58 -0500 Subject: [PATCH 5/6] ignore warning in doc --- doc/source/user_guide/visualization.rst | 1 + pandas/plotting/_matplotlib/core.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user_guide/visualization.rst b/doc/source/user_guide/visualization.rst index 5bc87bca87211..24c22c2e35477 100644 --- a/doc/source/user_guide/visualization.rst +++ b/doc/source/user_guide/visualization.rst @@ -668,6 +668,7 @@ A ``ValueError`` will be raised if there are any negative values in your data. plt.figure() .. ipython:: python + :okwarning: series = pd.Series(3 * np.random.rand(4), index=['a', 'b', 'c', 'd'], name='series') diff --git a/pandas/plotting/_matplotlib/core.py b/pandas/plotting/_matplotlib/core.py index 7b6f5bfa692e3..b490e07e43753 100644 --- a/pandas/plotting/_matplotlib/core.py +++ b/pandas/plotting/_matplotlib/core.py @@ -1520,7 +1520,6 @@ def _validate_color_args(self): def _make_plot(self): colors = self._get_colors(num_colors=len(self.data), color_kwds="colors") self.kwds.setdefault("colors", colors) - self.kwds.setdefault("normalize", False) for i, (label, y) in enumerate(self._iter_data()): ax = self._get_ax(i) From dfe56c0cbed7128d9f373d58b560b624dbb8dbfc Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Tue, 18 Aug 2020 13:05:59 -0500 Subject: [PATCH 6/6] ignore warning in doc --- doc/source/user_guide/visualization.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/user_guide/visualization.rst b/doc/source/user_guide/visualization.rst index 24c22c2e35477..8ce4b30c717a4 100644 --- a/doc/source/user_guide/visualization.rst +++ b/doc/source/user_guide/visualization.rst @@ -743,6 +743,7 @@ If you pass values whose sum total is less than 1.0, matplotlib draws a semicirc plt.figure() .. ipython:: python + :okwarning: series = pd.Series([0.1] * 4, index=['a', 'b', 'c', 'd'], name='series2')