home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 232350436

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
232350436 MDU6SXNzdWUyMzIzNTA0MzY= 1434 xr.concat loses coordinate dtype information with recarrays in 0.9 2805515 closed 0     10 2017-05-30T19:04:07Z 2023-01-23T16:22:15Z 2023-01-23T10:23:48Z CONTRIBUTOR      

Simple example script:

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

p1 = np.array([('A', 180), ('B', 150), ('C', 200)], dtype=[('name', '|S256'), ('height', int)]) p2 = np.array([('D', 170), ('E', 250), ('F', 150)], dtype=[('name', '|S256'), ('height', int)])

data1 = np.arange(50, 80, 1, dtype=np.float) data2 = data1 * 2

dims = ['measurement', 'participant']

da1 = xr.DataArray( data1.reshape(10, 3), coords={ 'measurement': np.arange(10), 'participant': p1, 'samplerate': 1 }, dims=dims )

da2 = xr.DataArray( data2.reshape(10, 3), coords={ 'measurement': np.arange(10), 'participant': p2, 'samplerate': 1 }, dims=dims )

combined = xr.concat([da1, da2], dim='participant') print(da1.participant.dtype) print(da2.participant.dtype) print(combined.participant.dtype) ```

With xarray version 0.9.5 (and 0.8.2), this results in:

[('name', 'S256'), ('height', '<i8')] [('name', 'S256'), ('height', '<i8')] object

We have to go all the way back to xarray version 0.7 to get the expected behavior:

[('name', 'S256'), ('height', '<i8')] [('name', 'S256'), ('height', '<i8')] [('name', 'S256'), ('height', '<i8')]

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1434/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

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