home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

2 rows where user = 1063143 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 1

  • issue 2

state 1

  • closed 2

repo 1

  • xarray 2
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
159536177 MDU6SXNzdWUxNTk1MzYxNzc= 878 Allow passing a default value (instead of ndarray) for data argument for DataArray joonro 1063143 closed 0     3 2016-06-10T00:18:12Z 2019-08-26T20:36:36Z 2019-08-26T20:36:36Z NONE      

Hi,

First of all, thanks a lot for the amazing module. It seems when I create a DataArray, I have to pass a numpy.ndarray with a correct size for the data argument. It works well when I already have some data, but sometimes I want to create an "empty" DataArray with known coordinates and fill up the data later. For these cases, it would be great if xarray allows passing just a value for the data argument, and fill up all the elements of the array with the value. For example, with pandas, I can do:

python import pandas as pd test = pd.DataFrame(data=.1, index=range(100), columns=['col1', 'col2'])

and the resulting DataFrame would be:

``` python col1 col2 0 0.1 0.1 1 0.1 0.1 2 0.1 0.1 .. ... ... 97 0.1 0.1 98 0.1 0.1 99 0.1 0.1

[100 rows x 2 columns] ```

Thanks a lot!

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/878/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
173494017 MDU6SXNzdWUxNzM0OTQwMTc= 987 Return a scalar instead of DataArray when the return value is a scalar joonro 1063143 closed 0     11 2016-08-26T16:37:36Z 2016-08-28T20:19:19Z 2016-08-28T20:19:19Z NONE      

Hi,

I'm not sure how devs will feel about this, but I wanted to ask because I'm getting into this issue frequently.

Currently many methods such as .min(), .max(), .mean() returns a DataArray even for the cases where the return value is a scaler. For example,

``` python import numpy as np import xarray as xr test = xr.DataArray(data=np.ones((10, 10)))

In [6]: test.min() Out[6]: <xarray.DataArray ()> array(1.0) ```

which makes a lot of other things break down and I have to use test.min().values or float(test.min()). I think it would be great that these methods return a scalar when the return value is a scaler. For example,

python In [7]: np.ones((10, 10)).mean() Out[7]: 1.0

Thank you!

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/987/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 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 3681.174ms · About: xarray-datasette