home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 1294978633

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1294978633 I_kwDOAMm_X85NL85J 6754 to_array to create a dimension as last axis 17162724 closed 0     6 2022-07-06T01:28:50Z 2022-07-06T17:12:25Z 2022-07-06T17:12:25Z CONTRIBUTOR      

Is your feature request related to a problem?

I do ds.to_array(dim="variable").transpose("latitude", "longitude", "variable"). I would like to avoid the extra transpose call.

Describe the solution you'd like

ds.to_array(dim="variable", new_axis="last") where new_axis is Literal["first", "last"] = "first" or ds.to_array(dim="variable", new_axis=0) where new_axis is Literal[0, -1] = 0

code to change: https://github.com/pydata/xarray/blob/main/xarray/core/dataset.py#L5770

Describe alternatives you've considered

No response

Additional context

I imagine new_axis could be of type int to place the new axis where you would like but the proposal above may be a good first step.

For reference, i'm doing deep learning and want to shape the data as width (latitude), height (longitude), channel (feature)

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6754/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 6 rows from issue in issue_comments
Powered by Datasette · Queries took 157.551ms · About: xarray-datasette