home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 168754274

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
168754274 MDU6SXNzdWUxNjg3NTQyNzQ= 929 Dataset creation requires tuple, list treated differently 12307589 closed 0     4 2016-08-01T22:11:15Z 2019-02-26T08:51:17Z 2019-02-26T08:51:17Z CONTRIBUTOR      

Take the Dataset creation example:

python In [35]: ds = xr.Dataset({'temperature': (['x', 'y', 'time'], temp), ....: 'precipitation': (['x', 'y', 'time'], precip)}, ....: coords={'lon': (['x', 'y'], lon), ....: 'lat': (['x', 'y'], lat), ....: 'time': pd.date_range('2014-09-06', periods=3), ....: 'reference_time': pd.Timestamp('2014-09-05')}) ....:

if the tuple (['x', 'y', 'time'], temp) is replaced with a list [['x', 'y', 'time'], temp], the behavior changes in very strange ways. The resulting Dataset will then have a coordinate variable temperature whose dimensions are ('temperature', 'x', 'y', 'time'). Printing temperature shows that the ['x', 'y', 'time'] part has been interpreted as data rather than metadata. It seems to be impossible to access the data in the resulting temperature coordinate by indexing.

This might be intentional (since one could actually want to pass in data that is stored as a list), but it may be better to do some sanity checking when a list is passed to figure out whether the list is data or as above. If no change is made, then this feature should probably be pointed out in the documentation.

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

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