Title: _reshape_2D function behavior changed, breaks hist for some cases in 3.3.0 · Issue #18234 · matplotlib/matplotlib · GitHub
Open Graph Title: _reshape_2D function behavior changed, breaks hist for some cases in 3.3.0 · Issue #18234 · matplotlib/matplotlib
X Title: _reshape_2D function behavior changed, breaks hist for some cases in 3.3.0 · Issue #18234 · matplotlib/matplotlib
Description: Bug report Bug summary In version 3.2.2, plt.hist(df['class']) will produce a correct histogram where df['class'] is a series of strings. In version 3.3.0, _reshape_2D gives different output in this case, leading to slow computation and ...
Open Graph Description: Bug report Bug summary In version 3.2.2, plt.hist(df['class']) will produce a correct histogram where df['class'] is a series of strings. In version 3.3.0, _reshape_2D gives different output in thi...
X Description: Bug report Bug summary In version 3.2.2, plt.hist(df['class']) will produce a correct histogram where df['class'] is a series of strings. In version 3.3.0, _reshape_2D gives differe...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/18234
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"_reshape_2D function behavior changed, breaks hist for some cases in 3.3.0","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\nIn version 3.2.2, plt.hist(df['class']) will produce a correct histogram where df['class'] is a series of strings. In version 3.3.0, _reshape_2D gives different output in this case, leading to slow computation and a graph with too many bars.\r\n\r\n**Code for reproduction**\r\n\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 seaborn as sns\r\nimport matplotlib.pyplot as plt\r\ndf = sns.load_dataset('titanic')\r\nplt.hist(df['class'])\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\nThis is under matplotlib 3.3.0:\r\n\r\n\r\nThis is _reshape_2D under 3.3.0:\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\nThis is under matplotlib 3.2.2:\r\n\r\n\r\nThis is _reshape_2D under 3.2.2:\r\n\r\n\r\nCan produce the same output for 3.3.0 by putting the series in a list but ideally I think the behavior should remain the same since this unexpectedly also breaks other function behavior relying on this (pandas.DataFrame.hist(), plt.hist())\r\n\r\n\u003c!--A description of the expected outcome from the code snippet--\u003e\r\n\u003c!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on--\u003e\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: macOS Mojave 10.14.6\r\n * Matplotlib version: 3.3.0\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): module://ipykernel.pylab.backend_inline\r\n * Python version: 3.7.4\r\n * Jupyter version (if applicable):\r\n * Other libraries: numpy: 1.18.1, pandas: 1.1.0, seaborn: 0.9.0\r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\nmatplot lib installed via pip\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\n\r\n","author":{"url":"https://github.com/RyanBaten","@type":"Person","name":"RyanBaten"},"datePublished":"2020-08-12T20:57:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/18234/matplotlib/issues/18234"}
| 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:fb80f18b-0ae3-271e-2b52-19dfc767cba9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DEF4:299BCA:6B180:8EE80:6A526001 |
| html-safe-nonce | 3c0c813f9b10470e885621a26ea2df49ee3bc2248d70939b30e4456fac0eb4fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERUY0OjI5OUJDQTo2QjE4MDo4RUU4MDo2QTUyNjAwMSIsInZpc2l0b3JfaWQiOiI2MzQ2MzY2OTIyNDM5OTQyMTQ1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 872feff2e14366dfe35826d4bd953d06afd59f8aee37b54a4dc582d9fd807027 |
| hovercard-subject-tag | issue:677973424 |
| 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/18234/issue_layout |
| twitter:image | https://opengraph.githubassets.com/519a2d988234ad54a104b93ea1882452d5809220d90df9e805b8dca04841490e/matplotlib/matplotlib/issues/18234 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/519a2d988234ad54a104b93ea1882452d5809220d90df9e805b8dca04841490e/matplotlib/matplotlib/issues/18234 |
| og:image:alt | Bug report Bug summary In version 3.2.2, plt.hist(df['class']) will produce a correct histogram where df['class'] is a series of strings. In version 3.3.0, _reshape_2D gives different output in thi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RyanBaten |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width