home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 415209776

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
415209776 MDU6SXNzdWU0MTUyMDk3NzY= 2791 formatting of singleton DataArrays 6164157 closed 0     8 2019-02-27T16:22:34Z 2023-12-02T02:44:06Z 2023-12-02T02:44:05Z CONTRIBUTOR      

Code Sample, a copy-pastable example if possible

python a=xr.DataArray(1.234) '{:1.3f}'.format(a) # throws error '{:1.3f}'.format(a.values) # behaves nicely

Problem description

I think it would be useful for repr(a) to return repr(a.values) when a.ndim==0 and perhaps also when a.size==1. For example, this would make such code work: python a=xr.DataArray(range(4)) ' '.join('{:d}'.format(v) for v in a) while currently one has to write python ' '.join('{:d}'.format(v.values) for v in a) I tried to think whether this will break something else but I couldn't think of anything.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2791/reactions",
    "total_count": 1,
    "+1": 1,
    "-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
  • 7 rows from issue in issue_comments
Powered by Datasette · Queries took 0.588ms · About: xarray-datasette