Title: FIX: indexed pandas bar by jklymak · Pull Request #15166 · matplotlib/matplotlib · GitHub
Open Graph Title: FIX: indexed pandas bar by jklymak · Pull Request #15166 · matplotlib/matplotlib
X Title: FIX: indexed pandas bar by jklymak · Pull Request #15166 · matplotlib/matplotlib
Description: PR Summary Closes #15162 basically if you do df = pd.DataFrame({"x":[1,2,3],"width":[.2,.4,.6]},index=[1,2,3]), then df.x[0] errors because that index doesn't exist, which breaks bar. While I appreciate this is a bit more code than trying to call iat(0), which is what we did before, this solution doesn't presuppose iat exists. import pandas as pd from matplotlib import pyplot as plt import numpy as np df = pd.DataFrame({"x":[1.,2.,3.],"width":[.2,.4,.6]}, index=[1, 2, 3]) plt.figure() plt.bar(df.x, 1., width=df.width) plt.savefig('/Users/jklymak/downloads/Test1.png') df = pd.DataFrame({"x":[1,3,10]},index=[1000,2000,3000]) plt.figure() plt.bar(df.x, 1, width=.2) plt.savefig('/Users/jklymak/downloads/Test2.png') Now yields the expected (and pre 3.1.0): PR Checklist Has Pytest style unit tests Code is Flake 8 compliant New features are documented, with examples if plot related Documentation is sphinx and numpydoc compliant Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way
Open Graph Description: PR Summary Closes #15162 basically if you do df = pd.DataFrame({"x":[1,2,3],"width":[.2,.4,.6]},index=[1,2,3]), then df.x[0] errors because that index doesn't exist, which b...
X Description: PR Summary Closes #15162 basically if you do df = pd.DataFrame({"x":[1,2,3],"width":[.2,.4,.6]},index=[1,2,3]), then df.x[0] errors because that index doesn&...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/15166
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2955130f-49bd-8150-560c-a91dbc4f7a09 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B9A4:166C0A:530620F:749D537:6A571074 |
| html-safe-nonce | 4dcfff2cde08d10b07b9d24fc3b9997bd69bd0a1ab5003f4696c8d8b8aa4721d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUE0OjE2NkMwQTo1MzA2MjBGOjc0OUQ1Mzc6NkE1NzEwNzQiLCJ2aXNpdG9yX2lkIjoiMTU0Njk0NzU2MTM4MjE1NDM1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d4e0f316f6d66411aa1b8742d4234e06f0dce3ecb7bb76720548d5faa43d3637 |
| hovercard-subject-tag | pull_request:312988630 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/matplotlib/matplotlib/pull/15166/files |
| twitter:image | https://avatars.githubusercontent.com/u/1562854?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1562854?s=400&v=4 |
| og:image:alt | PR Summary Closes #15162 basically if you do df = pd.DataFrame({"x":[1,2,3],"width":[.2,.4,.6]},index=[1,2,3]), then df.x[0] errors because that index doesn't exist, which b... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2576d1f0198cf1588faf2edf27f1ed120903be10 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width