home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 386835630

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/1699#issuecomment-386835630 https://api.github.com/repos/pydata/xarray/issues/1699 386835630 MDEyOklzc3VlQ29tbWVudDM4NjgzNTYzMA== 1217238 2018-05-05T21:17:20Z 2018-05-05T21:17:20Z MEMBER

dtype = [getattr(x, 'dtype', getattr(x, 'dtypes'))] would be another alternative, but I agree it's ugly. The ternary expression dtype = x.dtypes if isinstance(x, xarray.Dataset) else x.dtype would also work.

I agree with the concern about duck typing, but my concern with Dataset.dtype is that there is strong convention for a dtype attribute to be an actual NumPy dtype.

Another option would be accept either objects with a dtype or dtypes in output_dtypes, like np.result_type(). Then you could write output_dtype=[x].

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