pull_requests: 99497806
This data as json
id | node_id | number | state | locked | title | user | body | created_at | updated_at | closed_at | merged_at | merge_commit_sha | assignee | milestone | draft | head | base | author_association | auto_merge | repo | url | merged_by |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
99497806 | MDExOlB1bGxSZXF1ZXN0OTk0OTc4MDY= | 1187 | closed | 0 | add quantile method to DataArray | 2443309 | This PR adds the `quantile` method to the DataArray. There may be a way to better fit this in with `.apply` or `reduce` it wasn't immediately clear to me how to do that. It uses `np.nanpercentile` under the hood so this shouldn't be expected to work well with dask. The main advantage to this method, over using `apply(np.nanpercentile)` is the handling of the `quantile` coordinate. example usage: ```Python In [12]: x = np.random.random(size=(2, 3, 800)) In [13]: da = xr.DataArray(x, dims=('x', 'y', 'time')) In [14]: da.quantile([1, 5, 10, 25, 50, 75, 90, 95, 99], dim='time', interpolation='lower') Out[14]: <xarray.DataArray (quantile: 9, x: 2, y: 3)> array([[[ 0.00835474, 0.01126747, 0.00778847], [ 0.00803924, 0.00919259, 0.01150164]], [[ 0.04902814, 0.05346976, 0.04493341], [ 0.04236611, 0.05273082, 0.05858802]], [[ 0.09370776, 0.09976448, 0.09256707], [ 0.08943787, 0.09331907, 0.08832309]], [[ 0.25416402, 0.22577298, 0.24407393], [ 0.25386087, 0.23052584, 0.24621966]], [[ 0.534169 , 0.46017551, 0.49817391], [ 0.50968059, 0.49427688, 0.51573855]], [[ 0.76633412, 0.73405412, 0.77210754], [ 0.76759837, 0.74243892, 0.76703357]], [[ 0.90832116, 0.89495854, 0.91818434], [ 0.91492771, 0.88063773, 0.91416636]], [[ 0.95260527, 0.95132871, 0.95979701], [ 0.95988286, 0.93137055, 0.95941658]], [[ 0.98597133, 0.98883232, 0.99013424], [ 0.98951238, 0.97550784, 0.99224201]]]) Coordinates: * quantile (quantile) float64 1.0 5.0 10.0 25.0 50.0 75.0 90.0 95.0 99.0 o x (x) - o y (y) - ``` closes #303 fixes #561 | 2016-12-28T01:06:51Z | 2017-01-23T18:23:06Z | 2017-01-23T18:22:14Z | 2017-01-23T18:22:14Z | d5f4af50d14de165e6d5a5be4826910540384fc7 | 0 | d8ba5694351b6948dee89748a8b4a38dfaa7f2bd | 80fbc6e46c5a36bd4bfe24c667bd44d1f4e8e53a | MEMBER | 13221727 | https://github.com/pydata/xarray/pull/1187 |
Links from other tables
- 0 rows from pull_requests_id in labels_pull_requests