home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

1 row where state = "open" and user = 90059220 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 1

  • issue 1

state 1

  • open · 1 ✖

repo 1

  • xarray 1
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
1268821199 I_kwDOAMm_X85LoKzP 6691 Rolling.argmin() and Rolling.argmax() over multiple dimensions does not work AlxLhrNc 90059220 open 0     2 2022-06-13T02:42:14Z 2022-06-17T02:54:27Z   NONE      

What is your issue?

I am working with xarray.core.rolling.DataArrayRolling objects and for some obscure reason, they raise the following error when the .argmin() and .argmax() methods are used: ``` window_size = {name: n for name in ['lat', 'lon']} window = data_nc.rolling(window_size, center=True) peak_min = window.argmin() peak_max = window.argmax()

Traceback (most recent call last): Input In [48] in <cell line: 3> File ~\Installed_Programs\Anaconda3\envs\phd\lib\site-packages\xarray\core\rolling.py:122 in method return self._numpy_or_bottleneck_reduce(

File ~\Installed_Programs\Anaconda3\envs\phd\lib\site-packages\xarray\core\rolling.py:541 in _numpy_or_bottleneck_reduce return self.reduce(array_agg_func, keep_attrs=keep_attrs, **kwargs)

File ~\Installed_Programs\Anaconda3\envs\phd\lib\site-packages\xarray\core\rolling.py:428 in reduce result = windows.reduce(

File ~\Installed_Programs\Anaconda3\envs\phd\lib\site-packages\xarray\core\dataarray.py:2696 in reduce var = self.variable.reduce(func, dim, axis, keep_attrs, keepdims, **kwargs)

File ~\Installed_Programs\Anaconda3\envs\phd\lib\site-packages\xarray\core\variable.py:1804 in reduce data = func(self.data, axis=axis, **kwargs)

File ~\Installed_Programs\Anaconda3\envs\phd\lib\site-packages\xarray\core\duck_array_ops.py:335 in f return func(values, axis=axis, **kwargs)

File <array_function internals>:180 in argmax

File ~\Installed_Programs\Anaconda3\envs\phd\lib\site-packages\numpy\core\fromnumeric.py:1216 in argmax return _wrapfunc(a, 'argmax', axis=axis, out=out, **kwds)

File ~\Installed_Programs\Anaconda3\envs\phd\lib\site-packages\numpy\core\fromnumeric.py:66 in _wrapfunc return _wrapit(obj, method, args, *kwds)

File ~\Installed_Programs\Anaconda3\envs\phd\lib\site-packages\numpy\core\fromnumeric.py:43 in _wrapit result = getattr(asarray(obj), method)(args, *kwds)

TypeError: 'tuple' object cannot be interpreted as an integer

````` As far as I understand, these methods are included based on thexarraydocumentation, so it should work as.min(),.max()or.mean()` are working fine: https://docs.xarray.dev/en/stable/generated/xarray.core.rolling.DataArrayRolling.argmax.html

Any insight on what I am doing wrong ?

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

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 19.025ms · About: xarray-datasette