Title: pyplot.plot using pandas series raises DeprecationWarning with pandas=1.0.0rc0 · Issue #16295 · matplotlib/matplotlib · GitHub
Open Graph Title: pyplot.plot using pandas series raises DeprecationWarning with pandas=1.0.0rc0 · Issue #16295 · matplotlib/matplotlib
X Title: pyplot.plot using pandas series raises DeprecationWarning with pandas=1.0.0rc0 · Issue #16295 · matplotlib/matplotlib
Description: Bug report Bug summary The code below raises DeprecationWarning from pandas=1.0.0rc0 when plt.plot is fed with two pandas.Series (using my matplotlib=3.1.0 instance). It reproduces also when the series is not empty, and also when plottin...
Open Graph Description: Bug report Bug summary The code below raises DeprecationWarning from pandas=1.0.0rc0 when plt.plot is fed with two pandas.Series (using my matplotlib=3.1.0 instance). It reproduces also when the se...
X Description: Bug report Bug summary The code below raises DeprecationWarning from pandas=1.0.0rc0 when plt.plot is fed with two pandas.Series (using my matplotlib=3.1.0 instance). It reproduces also when the se...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/16295
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pyplot.plot using pandas series raises DeprecationWarning with pandas=1.0.0rc0","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\n\u003c!--A short 1-2 sentences that succinctly describes the bug--\u003e\r\nThe code below raises ``DeprecationWarning`` from ``pandas=1.0.0rc0`` when ``plt.plot`` is fed with two ``pandas.Series`` (using my matplotlib=3.1.0 instance). It reproduces also when the series is not empty, and also when plotting two different series as x and y. \r\n\r\n**Code for reproduction**\r\n\u003c!--A minimum code snippet required to reproduce the bug.\r\nPlease make sure to minimize the number of dependencies required, and provide\r\nany necessary plotted data.\r\nAvoid using threads, as Matplotlib is (explicitly) not thread-safe.--\u003e\r\n\r\n```python\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\n\r\nx = pd.Series([], dtype=\"float64\")\r\nplt.plot(x, x)\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"pandas1.py\", line 5, in \u003cmodule\u003e\r\n plt.plot(x, x)\r\n File \"/lib/python3.7/site-packages/matplotlib/pyplot.py\", line 2789, in plot\r\n is not None else {}), **kwargs)\r\n File \"/lib/python3.7/site-packages/matplotlib/axes/_axes.py\", line 1666, in plot\r\n lines = [*self._get_lines(*args, data=data, **kwargs)]\r\n File \"/lib/python3.7/site-packages/matplotlib/axes/_base.py\", line 225, in __call__\r\n yield from self._plot_args(this, kwargs)\r\n File \"/lib/python3.7/site-packages/matplotlib/axes/_base.py\", line 386, in _plot_args\r\n x = _check_1d(tup[0])\r\n File \"/lib/python3.7/site-packages/matplotlib/cbook/__init__.py\", line 1402, in _check_1d\r\n x[:, None]\r\n File \"/lib/python3.7/site-packages/pandas/core/series.py\", line 865, in __getitem__\r\n return self._get_with(key)\r\n File \"/lib/python3.7/site-packages/pandas/core/series.py\", line 878, in _get_with\r\n return self._get_values_tuple(key)\r\n File \"/lib/python3.7/site-packages/pandas/core/series.py\", line 920, in _get_values_tuple\r\n return self._get_values(key)\r\n File \"/lib/python3.7/site-packages/pandas/core/series.py\", line 934, in _get_values\r\n self._data.get_slice(indexer), fastpath=True\r\n File \"/lib/python3.7/site-packages/pandas/core/internals/managers.py\", line 1542, in get_slice\r\n return type(self)(self._block._slice(slobj), self.index[slobj], fastpath=True)\r\n File \"/lib/python3.7/site-packages/pandas/core/indexes/range.py\", line 708, in __getitem__\r\n return super().__getitem__(key)\r\n File \"/lib/python3.7/site-packages/pandas/core/indexes/base.py\", line 3908, in __getitem__\r\n deprecate_ndim_indexing(result)\r\n File \"/lib/python3.7/site-packages/pandas/core/indexes/base.py\", line 5553, in deprecate_ndim_indexing\r\n stacklevel=3,\r\nDeprecationWarning: Support for multi-dimensional indexing (e.g. `index[:, None]`) on an Index is deprecated and will be removed in a future version. Convert to a numpy array before indexing instead.\r\n```\r\n\r\n**Expected outcome**\r\n\r\nNo warnings.\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: linux\r\n * Matplotlib version: 3.1.0\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): agg\r\n * Python version: 3.7.3\r\n * Other libraries: pandas=1.0.0rc0\r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\npython and matplotlib obtained through anaconda, pandas through pip \r\n","author":{"url":"https://github.com/MaozGelbart","@type":"Person","name":"MaozGelbart"},"datePublished":"2020-01-22T21:38:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/16295/matplotlib/issues/16295"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cfcc4dda-d8f5-0be6-abee-fd07387ac46b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA14:6F8B4:B7BF2A:F7249F:6A56AC2B |
| html-safe-nonce | 2997ec589a948bb14f76a28ee8a25ee0a4783f7286d9616e9b0fbf80c4f1b6bf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTE0OjZGOEI0OkI3QkYyQTpGNzI0OUY6NkE1NkFDMkIiLCJ2aXNpdG9yX2lkIjoiODY4NjM1NDAwMjUzNDExNjM5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c207cc38a48178fb8873743227add2df89b7e199f5d69de7b148ecd4bfa6dcd1 |
| hovercard-subject-tag | issue:553808741 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/16295/issue_layout |
| twitter:image | https://opengraph.githubassets.com/38379adf540a6f995b0c4b39d0cc18f670ea28e8eb058e229d33f805d9fb7592/matplotlib/matplotlib/issues/16295 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/38379adf540a6f995b0c4b39d0cc18f670ea28e8eb058e229d33f805d9fb7592/matplotlib/matplotlib/issues/16295 |
| og:image:alt | Bug report Bug summary The code below raises DeprecationWarning from pandas=1.0.0rc0 when plt.plot is fed with two pandas.Series (using my matplotlib=3.1.0 instance). It reproduces also when the se... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MaozGelbart |
| hostname | github.com |
| expected-hostname | github.com |
| None | 13efe7fe8ecc41eda1078cbde8206041ed92bc54e29bcb737e9353dd9c407aad |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5466ebe023a0abf876a1e6c5d7602ee8f5e6a02b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width