home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 1133764387

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/issues/6423#issuecomment-1133764387 https://api.github.com/repos/pydata/xarray/issues/6423 1133764387 IC_kwDOAMm_X85Dk98j 5635139 2022-05-21T20:31:28Z 2022-05-21T20:31:28Z MEMBER

This does retain units on x:

``` In [9]: x=np.arange(100) ...: x=xr.DataArray(x, dims='x', coords={'x':x}, attrs={'units':'m'}) ...: t=np.arange(40,60,0.5) ...: t=xr.DataArray(t, dims='t', coords={'t':t}, attrs={'units':'s'}) ...: result = x.interp(x=t)

In [10]: result Out[10]: <xarray.DataArray (t: 40)> array([40. , 40.5, 41. , 41.5, 42. , 42.5, 43. , 43.5, 44. , 44.5, 45. , 45.5, 46. , 46.5, 47. , 47.5, 48. , 48.5, 49. , 49.5, 50. , 50.5, 51. , 51.5, 52. , 52.5, 53. , 53.5, 54. , 54.5, 55. , 55.5, 56. , 56.5, 57. , 57.5, 58. , 58.5, 59. , 59.5]) Coordinates: x (t) float64 40.0 40.5 41.0 41.5 42.0 ... 57.5 58.0 58.5 59.0 59.5 * t (t) float64 40.0 40.5 41.0 41.5 42.0 ... 57.5 58.0 58.5 59.0 59.5 Attributes: units: m ```

Which would you think we should retain?

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