home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 219184224

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
219184224 MDU6SXNzdWUyMTkxODQyMjQ= 1351 Creating a 2D DataArray 7300413 closed 0     5 2017-04-04T09:04:37Z 2017-04-04T16:19:12Z 2017-04-04T15:52:31Z NONE      

Hello,

I think I'm missing something simple here. I tried looking at the documentation, but no luck. I'm trying to create DataArrays whose coordinates are two dimensional as follows

```python from xarray import DataArray import numpy as np

x_physical = DataArray(np.ones((2,2)), dims = ['x_logical', 'y_logical'])

y_physical = DataArray(np.ones((2,2)), dims = ['x_logical', 'y_logical'])

new_array = DataArray(np.zeros((2,2)), dims=['x_logical','y_logical'], coords=[x_physical, y_physical]) ``` trying to follow the multidimensional example in the docs.

This gives me a ValueError: 'x_logical' has more than 1-dimension and the same name as one of its dimensions ('x_logical', 'y_logical'). xarray disallows such variables because they conflict with the coordinates used to label dimensions.

I have tried multiple variants of this:

  • replace x/y_logical in the arguments to creating new_array with something else, which gives me a ValueError: dimensions ('x',) must have the same length as the number of data dimensions, ndim=2

and some other variants which in hindsight make no sense.

Is there something I'm missing, and is creating multidimensional DataArrays documented somewhere?

TIA, Joy

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1351/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

  • 0 rows from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.638ms · About: xarray-datasette