René's URL Explorer Experiment


Title: [Bug]: `plt.pcolormesh` crashes when called with `Int64` nullable dtype · Issue #23991 · matplotlib/matplotlib · GitHub

Open Graph Title: [Bug]: `plt.pcolormesh` crashes when called with `Int64` nullable dtype · Issue #23991 · matplotlib/matplotlib

X Title: [Bug]: `plt.pcolormesh` crashes when called with `Int64` nullable dtype · Issue #23991 · matplotlib/matplotlib

Description: Bug summary When calling plt.pcolormesh with a dataframe containing either of the pandas nullable dtypes (Int64 or Float64) it crashes. Code for reproduction import matplotlib.pyplot as plt import pandas as pd df = pd.DataFrame({ 'foo' :...

Open Graph Description: Bug summary When calling plt.pcolormesh with a dataframe containing either of the pandas nullable dtypes (Int64 or Float64) it crashes. Code for reproduction import matplotlib.pyplot as plt import ...

X Description: Bug summary When calling plt.pcolormesh with a dataframe containing either of the pandas nullable dtypes (Int64 or Float64) it crashes. Code for reproduction import matplotlib.pyplot as plt import ...

Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23991

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: `plt.pcolormesh` crashes when called with `Int64` nullable dtype","articleBody":"### Bug summary\n\nWhen calling `plt.pcolormesh` with a dataframe containing either of the pandas nullable dtypes (`Int64` or `Float64`) it crashes.\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\n\r\ndf = pd.DataFrame({\r\n    'foo' : [1,2],\r\n    'bar' : [3,np.nan]\r\n    })\r\n\r\n# works as expected\r\nplt.pcolormesh(df)\r\n\r\n# crashes\r\nplt.pcolormesh(df.astype('Int64'))\n```\n\n\n### Actual outcome\n\n```\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\nInput In [28], in \u003ccell line: 13\u003e()\r\n     10 plt.pcolormesh(df)\r\n     12 # crashes\r\n---\u003e 13 plt.pcolormesh(df.astype('Int64'))\r\n\r\nFile ~/.virtualenvs/teaching/lib/python3.10/site-packages/matplotlib/pyplot.py:2728, in pcolormesh(alpha, norm, cmap, vmin, vmax, shading, antialiased, data, *args, **kwargs)\r\n   2723 @_copy_docstring_and_deprecators(Axes.pcolormesh)\r\n   2724 def pcolormesh(\r\n   2725         *args, alpha=None, norm=None, cmap=None, vmin=None,\r\n   2726         vmax=None, shading=None, antialiased=False, data=None,\r\n   2727         **kwargs):\r\n-\u003e 2728     __ret = gca().pcolormesh(\r\n   2729         *args, alpha=alpha, norm=norm, cmap=cmap, vmin=vmin,\r\n   2730         vmax=vmax, shading=shading, antialiased=antialiased,\r\n   2731         **({\"data\": data} if data is not None else {}), **kwargs)\r\n   2732     sci(__ret)\r\n   2733     return __ret\r\n\r\nFile ~/.virtualenvs/teaching/lib/python3.10/site-packages/matplotlib/__init__.py:1414, in _preprocess_data.\u003clocals\u003e.inner(ax, data, *args, **kwargs)\r\n   1411 @functools.wraps(func)\r\n   1412 def inner(ax, *args, data=None, **kwargs):\r\n   1413     if data is None:\r\n-\u003e 1414         return func(ax, *map(sanitize_sequence, args), **kwargs)\r\n   1416     bound = new_sig.bind(ax, *args, **kwargs)\r\n   1417     auto_label = (bound.arguments.get(label_namer)\r\n   1418                   or bound.kwargs.get(label_namer))\r\n\r\nFile ~/.virtualenvs/teaching/lib/python3.10/site-packages/matplotlib/axes/_axes.py:6072, in Axes.pcolormesh(self, alpha, norm, cmap, vmin, vmax, shading, antialiased, *args, **kwargs)\r\n   6068 C = C.ravel()\r\n   6070 kwargs.setdefault('snap', rcParams['pcolormesh.snap'])\r\n-\u003e 6072 collection = mcoll.QuadMesh(\r\n   6073     coords, antialiased=antialiased, shading=shading,\r\n   6074     array=C, cmap=cmap, norm=norm, alpha=alpha, **kwargs)\r\n   6075 collection._scale_norm(norm, vmin, vmax)\r\n   6076 self._pcolor_grid_deprecation_helper()\r\n\r\nFile ~/.virtualenvs/teaching/lib/python3.10/site-packages/matplotlib/collections.py:2015, in QuadMesh.__init__(self, *args, **kwargs)\r\n   2012 self._bbox.update_from_data_xy(self._coordinates.reshape(-1, 2))\r\n   2013 # super init delayed after own init because array kwarg requires\r\n   2014 # self._coordinates and self._shading\r\n-\u003e 2015 super().__init__(**kwargs)\r\n   2016 self.mouseover = False\r\n\r\nFile ~/.virtualenvs/teaching/lib/python3.10/site-packages/matplotlib/collections.py:217, in Collection.__init__(self, edgecolors, facecolors, linewidths, linestyles, capstyle, joinstyle, antialiaseds, offsets, transOffset, norm, cmap, pickradius, hatch, urls, zorder, **kwargs)\r\n    214 self._transOffset = transOffset\r\n    216 self._path_effects = None\r\n--\u003e 217 self.update(kwargs)\r\n    218 self._paths = None\r\n\r\nFile ~/.virtualenvs/teaching/lib/python3.10/site-packages/matplotlib/artist.py:1069, in Artist.update(self, props)\r\n   1066             if not callable(func):\r\n   1067                 raise AttributeError(f\"{type(self).__name__!r} object \"\r\n   1068                                      f\"has no property {k!r}\")\r\n-\u003e 1069             ret.append(func(v))\r\n   1070 if ret:\r\n   1071     self.pchanged()\r\n\r\nFile ~/.virtualenvs/teaching/lib/python3.10/site-packages/matplotlib/collections.py:2077, in QuadMesh.set_array(self, A)\r\n   2072     if faulty_data:\r\n   2073         raise TypeError(\r\n   2074             f\"Dimensions of A {A.shape} are incompatible with \"\r\n   2075             f\"X ({width}) and/or Y ({height})\")\r\n-\u003e 2077 return super().set_array(A)\r\n\r\nFile ~/.virtualenvs/teaching/lib/python3.10/site-packages/matplotlib/cm.py:477, in ScalarMappable.set_array(self, A)\r\n    475 A = cbook.safe_masked_invalid(A, copy=True)\r\n    476 if not np.can_cast(A.dtype, float, \"same_kind\"):\r\n--\u003e 477     raise TypeError(f\"Image data of dtype {A.dtype} cannot be \"\r\n    478                     \"converted to float\")\r\n    480 self._A = A\r\n\r\nTypeError: Image data of dtype object cannot be converted to float\r\n```\n\n### Expected outcome\n\n![image](https://user-images.githubusercontent.com/893512/191975740-f8e4d1ea-cfb1-4b0c-a94b-cef0d3781565.png)\r\n\n\n### Additional information\n\nNoticed via seaborn https://github.com/mwaskom/seaborn/issues/3042.\n\n### Operating system\n\nlubuntu\n\n### Matplotlib Version\n\n3.5.3\n\n### Matplotlib Backend\n\nmodule://matplotlib_inline.backend_inline\n\n### Python version\n\n3.10.4\n\n### Jupyter version\n\n6.4.12\n\n### Installation\n\npip","author":{"url":"https://github.com/mojones","@type":"Person","name":"mojones"},"datePublished":"2022-09-23T13:52:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":16},"url":"https://github.com/23991/matplotlib/issues/23991"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4a6f6ab3-4e11-120e-e202-c32de16da482
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB3A8:1FBDE0:1A61B2:23AFE9:6A52E287
html-safe-nonce82d3ea422b90083c3ff725c75eb2d590e41eb84bfbea901d8835ab6d26779ce1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0E4OjFGQkRFMDoxQTYxQjI6MjNBRkU5OjZBNTJFMjg3IiwidmlzaXRvcl9pZCI6IjQ0MzM5MjE1MzI4OTc3MTQ4MjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac03adc1bab3d3a1042982eddb4f9ff3b476c6875009c6632ce6c8246a5194e716
hovercard-subject-tagissue:1383844151
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/23991/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4a9c1a69821e0e16e812f40bbf9917f2c7197f0d03689b51f5c0bef73d59f523/matplotlib/matplotlib/issues/23991
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4a9c1a69821e0e16e812f40bbf9917f2c7197f0d03689b51f5c0bef73d59f523/matplotlib/matplotlib/issues/23991
og:image:altBug summary When calling plt.pcolormesh with a dataframe containing either of the pandas nullable dtypes (Int64 or Float64) it crashes. Code for reproduction import matplotlib.pyplot as plt import ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemojones
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/23991#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F23991
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F23991
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/issues/23991
Reloadhttps://github.com/matplotlib/matplotlib/issues/23991
Reloadhttps://github.com/matplotlib/matplotlib/issues/23991
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/23991
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/23991
Notifications https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://github.com/matplotlib/matplotlib
Issues 1.1k https://github.com/matplotlib/matplotlib/issues
Pull requests 408 https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Code https://github.com/matplotlib/matplotlib
Issues https://github.com/matplotlib/matplotlib/issues
Pull requests https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
[Bug]: plt.pcolormesh crashes when called with Int64 nullable dtypehttps://github.com/matplotlib/matplotlib/issues/23991#top
status: upstream fix requiredhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22status%3A%20upstream%20fix%20required%22
third-party integration: pandashttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22third-party%20integration%3A%20pandas%22
topic: units and array ducktypeshttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20units%20and%20array%20ducktypes%22
https://github.com/mojones
mojoneshttps://github.com/mojones
on Sep 23, 2022https://github.com/matplotlib/matplotlib/issues/23991#issue-1383844151
https://user-images.githubusercontent.com/893512/191975740-f8e4d1ea-cfb1-4b0c-a94b-cef0d3781565.png
mwaskom/seaborn#3042https://github.com/mwaskom/seaborn/issues/3042
status: upstream fix requiredhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22status%3A%20upstream%20fix%20required%22
third-party integration: pandashttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22third-party%20integration%3A%20pandas%22
topic: units and array ducktypeshttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20units%20and%20array%20ducktypes%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.