home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where issue = 186868181 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 6

  • smartass101 2
  • shoyer 2
  • burnpanck 2
  • stale[bot] 1
  • openSourcerer9000 1
  • aberges-grd 1

author_association 3

  • NONE 5
  • CONTRIBUTOR 2
  • MEMBER 2

issue 1

  • DataArray.apply is missing · 9 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1303907119 https://github.com/pydata/xarray/issues/1074#issuecomment-1303907119 https://api.github.com/repos/pydata/xarray/issues/1074 IC_kwDOAMm_X85NuAsv aberges-grd 103256364 2022-11-04T17:18:57Z 2022-11-04T17:18:57Z NONE

I want to apply a function over a given axis. This functionality is well defined and not covered by pipe (well, you can select the axis INSIDE the function passed, but it's bad practice because that means the function has an extra parameter to select the axis, not very KISS imo)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.apply is missing 186868181
873026293 https://github.com/pydata/xarray/issues/1074#issuecomment-873026293 https://api.github.com/repos/pydata/xarray/issues/1074 MDEyOklzc3VlQ29tbWVudDg3MzAyNjI5Mw== openSourcerer9000 61931826 2021-07-02T14:07:05Z 2021-07-02T14:08:22Z NONE

Not stale! Why not follow the pd convention of map vs apply for dataarray vs dataset?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.apply is missing 186868181
457306964 https://github.com/pydata/xarray/issues/1074#issuecomment-457306964 https://api.github.com/repos/pydata/xarray/issues/1074 MDEyOklzc3VlQ29tbWVudDQ1NzMwNjk2NA== stale[bot] 26384082 2019-01-24T18:33:55Z 2019-01-24T18:33:55Z NONE

In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here; otherwise it will be marked as closed automatically

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.apply is missing 186868181
261495282 https://github.com/pydata/xarray/issues/1074#issuecomment-261495282 https://api.github.com/repos/pydata/xarray/issues/1074 MDEyOklzc3VlQ29tbWVudDI2MTQ5NTI4Mg== smartass101 941907 2016-11-18T10:09:48Z 2016-11-18T10:09:48Z NONE

Actually, I think that pipe should default to raw=False if there even is to be such a parameter. the reason is that one usually uses pipe to chain together functions, each of which usually expect a DataArray and "downcasting" to ndarray often breaks such a chain. If you insist on having one method behave as if raw=True, then I think it should be apply in order to be constsent with the python apply function which simply applies the function and nothing more.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.apply is missing 186868181
261316492 https://github.com/pydata/xarray/issues/1074#issuecomment-261316492 https://api.github.com/repos/pydata/xarray/issues/1074 MDEyOklzc3VlQ29tbWVudDI2MTMxNjQ5Mg== shoyer 1217238 2016-11-17T17:44:21Z 2016-11-17T17:44:21Z MEMBER

@burnpanck I missed your comments from a few weeks ago. Yes, please do make PRs to update the docs.

I am OK with adding DataArray.apply for consistency and discoverability, even if it's basically an alias of DataArray.pipe. And if we add a raw argument I suppose it should probably default to raw=False for both .apply methods.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.apply is missing 186868181
261223890 https://github.com/pydata/xarray/issues/1074#issuecomment-261223890 https://api.github.com/repos/pydata/xarray/issues/1074 MDEyOklzc3VlQ29tbWVudDI2MTIyMzg5MA== smartass101 941907 2016-11-17T11:29:38Z 2016-11-17T11:29:38Z NONE

I think #1130 is related. I also think that apply is somewhat synonymous to pipe and is a lot more understandable for people without a pandas background. It would also be more consistent to have them both named the same on both Dataset and DataArray.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.apply is missing 186868181
258425477 https://github.com/pydata/xarray/issues/1074#issuecomment-258425477 https://api.github.com/repos/pydata/xarray/issues/1074 MDEyOklzc3VlQ29tbWVudDI1ODQyNTQ3Nw== burnpanck 1310437 2016-11-04T13:04:37Z 2016-11-04T13:04:37Z CONTRIBUTOR

As for the consistency concern, I wouldn't have expected that to be a big issue. I'd argue that most functions mapping np.ndarray -> np.ndarray will not mind receiving a DataArray instead. On the other hand, functions mapping DataArray -> np.ndarray would seldom prefer to receive the raw np.ndarray. So I see no use to the raw parameter (but then again, I do not know pandas and their use-case), such that my hypotetical DataArray.apply and the existing DataArray.pipe are essentially the same.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.apply is missing 186868181
258423515 https://github.com/pydata/xarray/issues/1074#issuecomment-258423515 https://api.github.com/repos/pydata/xarray/issues/1074 MDEyOklzc3VlQ29tbWVudDI1ODQyMzUxNQ== burnpanck 1310437 2016-11-04T12:55:15Z 2016-11-04T12:55:15Z CONTRIBUTOR

Aha! For my use-case, DataArray.pipe is perfectly fine, I just didn't know about it. I have to admit that I know nothing about pandas. Before I learned about xarray, pandas was not interesting to me at all. My datasets are often high-dimensional which does not work well with pandas' orientation towards (one-dimensional) collections of observations. In that sense, I could rather relabel this issue (or create a new one) as a documentation problem. The API reference does not indicate the existence of DataArray.pipe at all (only Dataset.pipe, even though that one mentions it works on DataArrays too). Also, there could possibly be a see-also link to pipe from apply. Shall I have a go at a PR?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.apply is missing 186868181
258327585 https://github.com/pydata/xarray/issues/1074#issuecomment-258327585 https://api.github.com/repos/pydata/xarray/issues/1074 MDEyOklzc3VlQ29tbWVudDI1ODMyNzU4NQ== shoyer 1217238 2016-11-04T02:10:04Z 2016-11-04T02:10:04Z MEMBER

We could try to get in a simple version of this before #964.

My only concern is that the functionality here is slightly different from Dataset.apply, which takes functions that map DataArray -> DataArray or DataArray -> numpy.ndarray.

For DataArray.apply, we really want something that maps numpy.ndarray -> numpy.ndarray, which is now inconsistent. I guess we could pass the original DataArray to the function, but we already have a .pipe method for that.

This is also a concern for #964, because any new xarray.apply function would have similar consistency issues with Dataset.apply.

Two possible solutions, neither of which is fully satisfying: - New keyword argument raw to Dataset.apply, defaulting to False. Works like the raw argument to DataFrame.apply. If raw=True, then Dataset.apply passes unlabeled arrays to the provided function, like DataArray.apply. This makes the difference a little less jarring. - Pick a new name for one of these uses of apply, e.g., apply_raw for this use case. xarray.apply_raw or DataArray.apply_raw is pretty verbose, though.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.apply is missing 186868181

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