Skip to content

multi-dimensional category_edges for contingency, reliability, etc`` #278

Description

@aaronspring

so far with xhistogram, we can only create 1d category_edges. however, sometimes we would want to make category_edges multi-dimensional (dependent on lon and lat) when e.g. calculating wrt. climatological terciles.

inspired by #275 and used in #277

I found a way to bin datasets with multi-dim edges resulting in the same results as xhistogram.

e=[.1,.2,.4,.5,.7,.9]
edges = xr.DataArray(e, dims='edge')
(ds<edges).sum('member').diff('edge') == xs.core.utils.histogram(ds,bins=[np.array(e)],dim=['member']).rename({'var1_bin':'edge'})

sounds reasonable @dougiesquire ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions