home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 91676831 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

  • shoyer 2
  • ghost 1

author_association 2

  • MEMBER 2
  • NONE 1

issue 1

  • asarray Compatibility · 3 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
116412391 https://github.com/pydata/xarray/issues/448#issuecomment-116412391 https://api.github.com/repos/pydata/xarray/issues/448 MDEyOklzc3VlQ29tbWVudDExNjQxMjM5MQ== shoyer 1217238 2015-06-29T03:26:39Z 2015-06-29T03:26:39Z MEMBER

Xray doesn't use numpy ndarray subclasses, mostly because that would tie our underlying array implementations to numpy and stop us from using interesting alternative array implementations like dask. Hence, np.asanyarray does not work either.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  asarray Compatibility 91676831
116411269 https://github.com/pydata/xarray/issues/448#issuecomment-116411269 https://api.github.com/repos/pydata/xarray/issues/448 MDEyOklzc3VlQ29tbWVudDExNjQxMTI2OQ== ghost 10137 2015-06-29T03:22:52Z 2015-06-29T03:22:52Z NONE

I agree that it's the point with np.asarray, but given the implementation you'd think np.asanyarray would work. My initial takeaway (until examining the source) was that this was an ndarray with additional attributes and properties. Perhaps, I'm leaning too far towards numpy and too far away from pandas.

As background: my usage involves RF pattern data which typically involves a lot of independent variables to lug around as well as the measured data.

I'll look into your other suggestions. Thank you for your reply.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  asarray Compatibility 91676831
116406425 https://github.com/pydata/xarray/issues/448#issuecomment-116406425 https://api.github.com/repos/pydata/xarray/issues/448 MDEyOklzc3VlQ29tbWVudDExNjQwNjQyNQ== shoyer 1217238 2015-06-29T03:13:33Z 2015-06-29T03:13:33Z MEMBER

Unfortunately, there's no way to make np.asarray return anything other than a numpy array without metadata -- that's kind of the entire point of asarray.

We do have some other options, though. The first two already work: - use xray.Dataset.apply to call a function, e.g., ds.apply(db2w) - write a numpy universal function using numba:

python @numba.vectorize def db2w(arr): return 10 ** (arr / 20.0) - we could write a modified version of asarray that passes through xray objects - we could write a decorator that transforms a function to preserve/restore xray metadata, e.g.,

``` python def keep_metadata(func): def wrapper(array, **kwargs): return array.array_wrap(func(array)) return wrapper

@keep_metadata def db2w(arr): return 10 ** (np.asarray(arr) / 20.0) ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  asarray Compatibility 91676831

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 64.101ms · About: xarray-datasette