home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 592715925

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/3810#issuecomment-592715925 https://api.github.com/repos/pydata/xarray/issues/3810 592715925 MDEyOklzc3VlQ29tbWVudDU5MjcxNTkyNQ== 7441788 2020-02-28T20:33:43Z 2020-02-28T20:35:57Z CONTRIBUTOR

A few minor tweaks needed: ``` In [20]: import bottleneck

In [21]: xr.apply_ufunc( ...: lambda x: bottleneck.rankdata(x).reshape(x.shape), ...: d, ...: input_core_dims=[['xyz', 'abc']], ...: output_core_dims=[['xyz', 'abc']], ...: vectorize=True ...: ).transpose(*d.dims)
Out[21]: <xarray.DataArray (abc: 4, xyz: 3)> array([[ 1., 2., 3.], [ 4., 5., 6.], [ 7., 8., 9.], [10., 11., 12.]]) Dimensions without coordinates: abc, xyz ```

Despite what the docs say, bottleneck.{nan}rankdata(a) returns a 1-dimensional ndarray, not an array with the same shape as a.

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