home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

1 row where user = 881019 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
442063346 MDU6SXNzdWU0NDIwNjMzNDY= 2949 xr.DataArray.to_series returns a (mutable) view dhirschfeld 881019 open 0     8 2019-05-09T06:02:23Z 2020-11-16T21:58:10Z   NONE      

Code Sample, a copy-pastable example if possible

```python import numpy as np import pandas as pd import xarray as xr

dates = pd.date_range('01-Jan-2019', '01-Jan-2020', name='forward_date')[:-1] s = pd.Series(np.random.randn(dates.size), dates) array = xr.DataArray.from_series(s) python In [52]: array Out[52]: <xarray.DataArray (forward_date: 365)> array([ 0.511149, -1.009054, -0.098397, ..., 0.496596, 1.435346, 0.21206 ]) Coordinates: * forward_date (forward_date) datetime64[ns] 2019-01-01 ... 2019-12-31

In [53]: array.to_series().index.name Out[53]: 'forward_date'

In [54]: array.to_series().index.name = 'peristent!!!'

In [55]: array.to_series().index.name Out[55]: 'peristent!!!'

In [56]: array.get_index('forward_date') Out[56]: DatetimeIndex(['2019-01-01', '2019-01-02', '2019-01-03', '2019-01-04', '2019-01-05', '2019-01-06', '2019-01-07', '2019-01-08', '2019-01-09', '2019-01-10', ... '2019-12-22', '2019-12-23', '2019-12-24', '2019-12-25', '2019-12-26', '2019-12-27', '2019-12-28', '2019-12-29', '2019-12-30', '2019-12-31'], dtype='datetime64[ns]', name='peristent!!!', length=365, freq='D') ```

Problem description

IMHO Setting index.name on the returned series shouldn't affect the original DataArray - i.e. every call to array.to_series().index.name should return forward_date irrespective of any mutating operations performed on the returned series.

Expected Output

Output of xr.show_versions()

```python In [48]: xr.show_versions() Traceback (most recent call last): File "<ipython-input-48-6f391305f2fe>", line 1, in <module> xr.show_versions() File "C:\Users\dhirschf\envs\dev\lib\site-packages\xarray\util\print_versions.py", line 84, in show_versions sys_info.extend(netcdf_and_hdf5_versions()) File "C:\Users\dhirschf\envs\dev\lib\site-packages\xarray\util\print_versions.py", line 75, in netcdf_and_hdf5_versions libhdf5_version = h5py.__hdf5libversion__ AttributeError: module 'h5py' has no attribute '__hdf5libversion__' ```
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2949/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 23.472ms · About: xarray-datasette