home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 511506569

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/pull/3126#issuecomment-511506569 https://api.github.com/repos/pydata/xarray/issues/3126 511506569 MDEyOklzc3VlQ29tbWVudDUxMTUwNjU2OQ== 2818208 2019-07-15T17:59:23Z 2019-07-15T17:59:23Z CONTRIBUTOR

@max-sixty, name is just a mutable property on a Pandas index:

```python

dates = pd.date_range('01-Jan-2019', '31-Jan-2019', name='mutable?') series = pd.Series(np.random.randn(dates.size), dates) series.index.name 'mutable?' series.index.name = 'yes' series.index.name 'yes' ```

But you're right that to_series is the wrong place. It looks like to_series calls to_index, which calls get_index, which is inherited by other classes such as Dataset. For example, the bug persists with Dataset despite my fix:

```python

dates = pd.date_range('01-Jan-2019', '31-Jan-2019', name='mutable?') series = pd.Series(np.random.randn(dates.size), dates) dataset = xr.Dataset({'foo': series}) dataset.indexes['mutable?'].name = 'yes' dataset.indexes['mutable?'].name 'yes' ```

Does anyone know if get_index is the best place for this? Maybe the tests should be somewhere more generic as well.

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