home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 354699553

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/1807#issuecomment-354699553 https://api.github.com/repos/pydata/xarray/issues/1807 354699553 MDEyOklzc3VlQ29tbWVudDM1NDY5OTU1Mw== 1217238 2018-01-02T03:47:10Z 2018-01-02T03:47:10Z MEMBER

Thanks for the report.

Creating a DataArray with a tuple actually creates a scalar (0-dimensional array): ``` In [40]: dr = xr.DataArray(())

In [41]: dr Out[41]: <xarray.DataArray ()> array((), dtype=object)

In [42]: dr.shape Out[42]: () `` We then raise aTypeError` when calculating the length of an empty DataArray, which is consistent with NumPy.

In contrast, if you make an empty DataArray with an empty list, you do get a 1D dimensional length 0 array: ``` In [54]: dr = xr.DataArray([])

In [55]: len(dr) Out[55]: 0

In [56]: dr.shape Out[56]: (0,) ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  285349783
Powered by Datasette · Queries took 0.707ms · About: xarray-datasette