home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 264517839 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 2

  • crusaderky 2
  • shoyer 1

issue 1

  • Option for arithmetics to ignore nans created by alignment · 3 ✖

author_association 1

  • MEMBER 3
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
510415725 https://github.com/pydata/xarray/issues/1625#issuecomment-510415725 https://api.github.com/repos/pydata/xarray/issues/1625 MDEyOklzc3VlQ29tbWVudDUxMDQxNTcyNQ== crusaderky 6213168 2019-07-11T09:48:07Z 2019-07-11T09:48:07Z MEMBER

Closed by #2876

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Option for arithmetics to ignore nans created by alignment 264517839
378904185 https://github.com/pydata/xarray/issues/1625#issuecomment-378904185 https://api.github.com/repos/pydata/xarray/issues/1625 MDEyOklzc3VlQ29tbWVudDM3ODkwNDE4NQ== crusaderky 6213168 2018-04-05T11:26:23Z 2018-04-05T11:26:23Z MEMBER

Updated title. I'm happy with the explicit approach. New design prototype: ``` wallet, restaurant_bill = xarray.align(wallet, restaurant_bill, join='outer', fill_value=0) print(wallet - restaurant_bill)

<xarray.DataArray (currency: 2)> array([50, 40]) Coordinates: * currency (currency) object 'EUR' 'USD' ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Option for arithmetics to ignore nans created by alignment 264517839
335849053 https://github.com/pydata/xarray/issues/1625#issuecomment-335849053 https://api.github.com/repos/pydata/xarray/issues/1625 MDEyOklzc3VlQ29tbWVudDMzNTg0OTA1Mw== shoyer 1217238 2017-10-11T15:26:36Z 2017-10-11T15:26:36Z MEMBER

This behavior is consistent with the default behavior on pandas, which always does an outer join for arithmetic: In [6]: wallet.to_series() - restaurant_bill.to_series() currency EUR NaN USD 40.0 dtype: float64 So I don't think we want to change this in an inconsistent way in xarray.

I do agree that we should have support for an explicit fill value in alignment/reindexing and arithmetic. For consistency with pandas (and elsewhere in xarray), let's call it fill_value.

  • change __add__,__sub__ etc. to invoke xarray.align(fillvalue=0)
  • change __mul__, __truediv__ etc. to invoke xarray.align(fillvalue=1)

I can see the logic in using an identity value instead of NaN as a default in arithmetic. One peril of this approach is that it isn't always evident what the right identity is. In fact, according to NumPy: ``` In [16]: import numpy as np

In [17]: print(np.add.identity) 0

In [18]: print(np.multiply.identity) 1

In [19]: print(np.subtract.identity) None

In [20]: print(np.divide.identity) None ```

Let me give a couple other examples of why I don't think we should use an identity of some sort as the default: - Suppose we are comparing a model to observations. model - observations gives the residuals -- unless the variables are mis-aligned, in which case it would give a residual equal to one of the variables. - Suppose we want to do a weighted average. (observations * weights).sum() gives a sensible answer -- but not if a missing weight defaults to 1 (all the weights put together are supposed to sum to 1!).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Option for arithmetics to ignore nans created by alignment 264517839

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 13.188ms · About: xarray-datasette