home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 159536177

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
159536177 MDU6SXNzdWUxNTk1MzYxNzc= 878 Allow passing a default value (instead of ndarray) for data argument for DataArray 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 13221727 issue

Links from other tables

  • 3 rows from issues_id in issues_labels
  • 3 rows from issue in issue_comments
Powered by Datasette · Queries took 0.731ms · About: xarray-datasette