home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where issue = 864494256 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

  • max-sixty 5
  • babameme 4

author_association 2

  • MEMBER 5
  • NONE 4

issue 1

  • Clip function with minimum or maximum nan value · 9 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
825050144 https://github.com/pydata/xarray/issues/5205#issuecomment-825050144 https://api.github.com/repos/pydata/xarray/issues/5205 MDEyOklzc3VlQ29tbWVudDgyNTA1MDE0NA== max-sixty 5635139 2021-04-22T17:34:39Z 2021-04-22T17:34:39Z MEMBER

I got the sign wrong, corrected:

```

In [4]: lower_inf = lower.where(lower.notnull(), -np.inf)

In [5]: da.clip(lower_inf, upper) Out[5]: <xarray.DataArray (x: 3, y: 6)> array([[ 1., 1., 2., 3., 4., 4.], [ 6., 7., 8., 9., 10., 10.], [12., 13., 14., 14., 14., 14.]]) Coordinates: * x (x) int64 0 1 2 * y (y) int64 0 1 2 3 4 5

```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clip function with minimum or maximum nan value 864494256
824600539 https://github.com/pydata/xarray/issues/5205#issuecomment-824600539 https://api.github.com/repos/pydata/xarray/issues/5205 MDEyOklzc3VlQ29tbWVudDgyNDYwMDUzOQ== babameme 21273359 2021-04-22T07:13:26Z 2021-04-22T07:13:26Z NONE

Wait, do you see the result on the 3rd row:

[14., 14., 14., 14., 14., 14.]

The original row is

[12, 13, 14, 15, 16, 17]

the lower bound is inf, and the upper bound is 14.

I think the result should be:

[12, 13, 14, 14, 14, 14]

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clip function with minimum or maximum nan value 864494256
824595756 https://github.com/pydata/xarray/issues/5205#issuecomment-824595756 https://api.github.com/repos/pydata/xarray/issues/5205 MDEyOklzc3VlQ29tbWVudDgyNDU5NTc1Ng== babameme 21273359 2021-04-22T07:05:34Z 2021-04-22T07:05:34Z NONE

I got it. Thank you very much

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clip function with minimum or maximum nan value 864494256
824556068 https://github.com/pydata/xarray/issues/5205#issuecomment-824556068 https://api.github.com/repos/pydata/xarray/issues/5205 MDEyOklzc3VlQ29tbWVudDgyNDU1NjA2OA== max-sixty 5635139 2021-04-22T05:45:07Z 2021-04-22T05:45:07Z MEMBER

It's still not great but it's sufficient!

What you want isn't available in numpy, the library we wrap:

```python

In [3]: da.values.clip(lower.values, upper.values) Out[3]: array([[ 1., 1., 2., 3., 4., 4.], [ 6., 7., 8., 9., 10., 10.], [nan, nan, nan, nan, nan, nan]]) ```

But I think what you want is this:

```python

In [11]: lower_inf = lower.where(lower.notnull(), np.inf)

In [14]: lower_inf Out[14]: <xarray.DataArray (x: 3, y: 6)> array([[ 1., 1., 1., 1., 1., 1.], [ 2., 2., 2., 2., 2., 2.], [inf, inf, inf, inf, inf, inf]]) Coordinates: * x (x) int64 0 1 2 * y (y) int64 0 1 2 3 4 5

In [12]: da.clip(lower_inf, upper) Out[12]: <xarray.DataArray (x: 3, y: 6)> array([[ 1., 1., 2., 3., 4., 4.], [ 6., 7., 8., 9., 10., 10.], [14., 14., 14., 14., 14., 14.]]) Coordinates: * x (x) int64 0 1 2 * y (y) int64 0 1 2 3 4 5 * ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clip function with minimum or maximum nan value 864494256
824534986 https://github.com/pydata/xarray/issues/5205#issuecomment-824534986 https://api.github.com/repos/pydata/xarray/issues/5205 MDEyOklzc3VlQ29tbWVudDgyNDUzNDk4Ng== babameme 21273359 2021-04-22T04:47:40Z 2021-04-22T04:47:40Z NONE

Hi @max-sixty , i update my request Let's check it, Regards

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clip function with minimum or maximum nan value 864494256
824521012 https://github.com/pydata/xarray/issues/5205#issuecomment-824521012 https://api.github.com/repos/pydata/xarray/issues/5205 MDEyOklzc3VlQ29tbWVudDgyNDUyMTAxMg== max-sixty 5635139 2021-04-22T04:02:45Z 2021-04-22T04:02:45Z MEMBER

If that's unclear, check out some other issues in the repo and use those as a template for yours.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clip function with minimum or maximum nan value 864494256
824520444 https://github.com/pydata/xarray/issues/5205#issuecomment-824520444 https://api.github.com/repos/pydata/xarray/issues/5205 MDEyOklzc3VlQ29tbWVudDgyNDUyMDQ0NA== max-sixty 5635139 2021-04-22T04:00:57Z 2021-04-22T04:00:57Z MEMBER

Sure — when you created the issue, there was a template in the text box — could you fill that out?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clip function with minimum or maximum nan value 864494256
824507009 https://github.com/pydata/xarray/issues/5205#issuecomment-824507009 https://api.github.com/repos/pydata/xarray/issues/5205 MDEyOklzc3VlQ29tbWVudDgyNDUwNzAwOQ== babameme 21273359 2021-04-22T03:15:13Z 2021-04-22T03:15:13Z NONE

Hi @max-sixty , this is the first time i request feature in github. Can you introduce how to fill out the issue template ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clip function with minimum or maximum nan value 864494256
824504715 https://github.com/pydata/xarray/issues/5205#issuecomment-824504715 https://api.github.com/repos/pydata/xarray/issues/5205 MDEyOklzc3VlQ29tbWVudDgyNDUwNDcxNQ== max-sixty 5635139 2021-04-22T03:08:03Z 2021-04-22T03:08:03Z MEMBER

Hi @babameme — please could you fill out the issue template, including formatting the code reasonably?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clip function with minimum or maximum nan value 864494256

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