home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 289519266

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/1326#issuecomment-289519266 https://api.github.com/repos/pydata/xarray/issues/1326 289519266 MDEyOklzc3VlQ29tbWVudDI4OTUxOTI2Ng== 6815844 2017-03-27T17:10:06Z 2017-03-27T17:10:06Z MEMBER

OK. I totally agree with you.

The API now I propose is

```Python def expand_dims(self, dim=None, axis=0): """Return a new object with an additional axis (or axes) inserted at the corresponding position in the array shape.

    Parameters
    ----------
    dim : str, list of strs, tuple of strs, or None
        Name(s) of new dimension.
        If a list (or tuple) of strings is passed, multiple axes are inserted.
        In this case, axis argument should be 0 or same length of integers indicating new axes positions.
    axis : integer, list of integers or tuple of integers
        Axis position(s) where new axis is to be inserted (position(s) on the result array).
        If a list (or tuple) of integers is passed, multiple axes are inserted.
        In this case, dim arguments should be None or same length list.

    Returns
    -------
    expanded : same type as caller
        This object, but with an additional dimension.

    Raises
    -------
    ValueError:
           If the length of axis and dim are different.
           If the axis is a list containing identical integers
           If axis is invalid (larger than the original dimension+1)

```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  216799807
Powered by Datasette · Queries took 0.754ms · About: xarray-datasette