home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 1596890616

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1596890616 I_kwDOAMm_X85fLp34 7552 plotting facet grid with singleton dimension should create a facet grid with size 1 73523466 closed 0     5 2023-02-23T13:39:35Z 2023-09-17T05:08:06Z 2023-09-17T05:08:06Z NONE      

What is your issue?

In my application, I want to plot facet grids of datasets, and the dimension I want to facet sometimes has a length of 1 and sometimes more than 1. When the length of the dimension is > 1, the plot(col=....) method of DataArray works as expected. However, when it is 1, I get an error and my code fails, although it would have been natrual for the plot method to create a FacetGrid with length of one facet.

As a minimal example, this code: python import xarray as xr da = xr.DataArray(np.random.rand(3,1), dims=('x', 'y')) da.plot(col='y') fails with an error: python KeyError: 'y' This example works as expected:

python import xarray as xr da = xr.DataArray(np.random.rand(3,2), dims=('x', 'y')) da.plot(col='y')

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7552/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 3 rows from issues_id in issues_labels
  • 4 rows from issue in issue_comments
Powered by Datasette · Queries took 14.374ms · About: xarray-datasette