home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

17 rows where issue = 187393785 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 7

  • shoyer 8
  • max-sixty 2
  • crusaderky 2
  • Yefee 2
  • rabernat 1
  • rafa-guedes 1
  • stale[bot] 1

author_association 3

  • MEMBER 13
  • NONE 3
  • CONTRIBUTOR 1

issue 1

  • Transpose some but not all dimensions · 17 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
544416092 https://github.com/pydata/xarray/issues/1081#issuecomment-544416092 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDU0NDQxNjA5Mg== crusaderky 6213168 2019-10-21T08:51:10Z 2019-10-21T08:51:23Z MEMBER

+1 for (2). Although user code that uses ... should not, by definition, care about the order of the variables that are not listed explicitly.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
544363547 https://github.com/pydata/xarray/issues/1081#issuecomment-544363547 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDU0NDM2MzU0Nw== shoyer 1217238 2019-10-21T06:09:40Z 2019-10-21T06:09:40Z MEMBER

I agree, I think (2) is what most users would expect.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
544358202 https://github.com/pydata/xarray/issues/1081#issuecomment-544358202 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDU0NDM1ODIwMg== max-sixty 5635139 2019-10-21T05:46:19Z 2019-10-21T05:46:19Z MEMBER

I would vote for (2), given it's fairly easy to replicate (1) by passing the full list, and I think (2) is arguably slightly more expected

(NB this isn't how #3421 works now, but easy to change)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
544350457 https://github.com/pydata/xarray/issues/1081#issuecomment-544350457 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDU0NDM1MDQ1Nw== shoyer 1217238 2019-10-21T05:06:02Z 2019-10-21T05:06:02Z MEMBER

There's one edge case that might be worth thinking carefully about here: Consider a dataset with two variables with dimensions ('w', 'x', 'y', 'z') and ('x', 'w', 'y', 'z'). Now we write .transpose(..., 'z', 'y'). What should the dimensions of variables on the resulting dataset be?

  1. Both ('w', 'x', 'z', 'y'), with ... filled in based on the order of dimensions in the overall dataset.
  2. ('w', 'x', 'y', 'z') and ('x', 'w', 'y', 'z'), with ... filled in for each variable separately.
{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
540678758 https://github.com/pydata/xarray/issues/1081#issuecomment-540678758 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDU0MDY3ODc1OA== shoyer 1217238 2019-10-10T16:58:59Z 2019-10-10T16:58:59Z MEMBER

Yes, this looks like a great use-case for Ellipsis!

On Thu, Oct 10, 2019 at 2:12 AM crusaderky notifications@github.com wrote:

From personal experience I find that 99% of the time, I want to push some known dimensions either to the front or to the back of the array while I don't care about the order of the others. I'd love to have this syntax:

transpose(..., "x", "y")

or

transpose("x", "y", ...)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pydata/xarray/issues/1081?email_source=notifications&email_token=AAJJFVXRM73GZLFJYZXR6JDQN3WY7A5CNFSM4CVHGIYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA3QQXQ#issuecomment-540477534, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJJFVW6IZJBW3KLMIU7IQDQN3WY7ANCNFSM4CVHGIYA .

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
540477534 https://github.com/pydata/xarray/issues/1081#issuecomment-540477534 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDU0MDQ3NzUzNA== crusaderky 6213168 2019-10-10T09:12:46Z 2019-10-10T09:14:28Z MEMBER

From personal experience I find that 99% of the time, I want to push some known dimensions either to the front or to the back of the array while I don't care about the order of the others. I'd love to have this syntax: python transpose(..., "x", "y") or python transpose("x", "y", ...) where the ellipsis expands to all dimensions not explicitly listed, in their original order. There can be at most one ellipsis.

{
    "total_count": 5,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 5,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
540140051 https://github.com/pydata/xarray/issues/1081#issuecomment-540140051 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDU0MDE0MDA1MQ== stale[bot] 26384082 2019-10-09T18:54:16Z 2019-10-09T18:54:16Z 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 or remove the stale label; 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
}
  Transpose some but not all dimensions 187393785
342906368 https://github.com/pydata/xarray/issues/1081#issuecomment-342906368 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDM0MjkwNjM2OA== shoyer 1217238 2017-11-08T18:14:56Z 2017-11-08T18:14:56Z MEMBER

tranpose('x', 'y') already means ensure this object has dimensions in the order (x, y): ``` In [2]: a = xarray.DataArray([[0]], dims=['x', 'y'])

In [3]: a.T Out[3]: <xarray.DataArray (y: 1, x: 1)> array([[0]]) Dimensions without coordinates: y, x

In [4]: a.T.transpose('x', 'y') Out[4]: <xarray.DataArray (x: 1, y: 1)> array([[0]]) Dimensions without coordinates: x, y

In [5]: a.transpose('x', 'y') Out[5]: <xarray.DataArray (x: 1, y: 1)> array([[0]]) Dimensions without coordinates: x, y ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
342898298 https://github.com/pydata/xarray/issues/1081#issuecomment-342898298 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDM0Mjg5ODI5OA== max-sixty 5635139 2017-11-08T17:48:20Z 2017-11-08T17:48:20Z MEMBER

ds.transpose('lat', 'lon') seems pretty unambiguous.

Though I think that would have radically different behavior for a 2-dim or 3-dim case. For the 2-dim case, it would enforce that order regardless of original order. For the 3-dim case, are you proposing they're swapped from their current order?

(Maybe transpose naturally refers to the behavior I think you describe, we'd need something else to 'set this order')

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
342892003 https://github.com/pydata/xarray/issues/1081#issuecomment-342892003 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDM0Mjg5MjAwMw== shoyer 1217238 2017-11-08T17:27:06Z 2017-11-08T17:27:06Z MEMBER

What about allowing .transpose() to handle a subset of array/dataset dimensions? In NumPy, this may not be desirable because it's easy to mix up integer dimensions, but in xarray ds.transpose('lat', 'lon') seems pretty unambiguous.

The implementation would simply reorder all the listed dimensions, keeping other dimensions in their original order.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
323880231 https://github.com/pydata/xarray/issues/1081#issuecomment-323880231 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDMyMzg4MDIzMQ== rafa-guedes 7799184 2017-08-21T23:44:30Z 2017-08-21T23:56:54Z CONTRIBUTOR

I have also hit this issue, this method could be useful. I'm putting below my workaround in case it is any helpful: python def reorder_dims(darray, dim1, dim2): """ Interchange two dimensions of a DataArray in a similar way as numpy's swap_axes """ dims = list(darray.dims) assert set([dim1,dim2]).issubset(dims), 'dim1 and dim2 must be existing dimensions in darray' ind1, ind2 = dims.index(dim1), dims.index(dim2) dims[ind2], dims[ind1] = dims[ind1], dims[ind2] return darray.transpose(*dims)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
258533613 https://github.com/pydata/xarray/issues/1081#issuecomment-258533613 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDI1ODUzMzYxMw== shoyer 1217238 2016-11-04T20:03:15Z 2016-11-04T20:03:15Z MEMBER

reorder_dims?

Would that be consistent with reorder_levels for MultIindex (#1028)? I'm not sure if that handles partial order specifications or not.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
258531906 https://github.com/pydata/xarray/issues/1081#issuecomment-258531906 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDI1ODUzMTkwNg== rabernat 1197350 2016-11-04T19:55:38Z 2016-11-04T19:55:38Z MEMBER

I have hit this issue before too.

We could add a method like numpy's swap_axes, it's just not clear what to name it.

reorder_dims?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
258531525 https://github.com/pydata/xarray/issues/1081#issuecomment-258531525 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDI1ODUzMTUyNQ== Yefee 6420873 2016-11-04T19:53:49Z 2016-11-04T19:53:49Z NONE

Thanks! I will check it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
258530895 https://github.com/pydata/xarray/issues/1081#issuecomment-258530895 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDI1ODUzMDg5NQ== shoyer 1217238 2016-11-04T19:50:54Z 2016-11-04T19:50:54Z MEMBER

You need to provide the full list of dimensions to transpose.

We could add a method like numpy's swap_axes, it's just not clear what to name it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
258530348 https://github.com/pydata/xarray/issues/1081#issuecomment-258530348 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDI1ODUzMDM0OA== Yefee 6420873 2016-11-04T19:48:20Z 2016-11-04T19:48:20Z NONE

Thanks, @shoyer

I agree your methods works for 2d matrix, but for 3 or 4d matrix it fails.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785
258529683 https://github.com/pydata/xarray/issues/1081#issuecomment-258529683 https://api.github.com/repos/pydata/xarray/issues/1081 MDEyOklzc3VlQ29tbWVudDI1ODUyOTY4Mw== shoyer 1217238 2016-11-04T19:45:14Z 2016-11-04T19:45:14Z MEMBER

swap_dims does something very different from swap_axes in numpy (we should add an example to make this clear).

For what you want, I think transpose is a closer fit, e.g., foo.transpose('lon', 'lat')

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Transpose some but not all dimensions 187393785

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