home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 551344538 and user = 14808389 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 1

  • keewis · 6 ✖

issue 1

  • Error using reduce(): percentile() got an unexpected keyword argument 'axis' · 6 ✖

author_association 1

  • MEMBER 6
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
575737878 https://github.com/pydata/xarray/issues/3701#issuecomment-575737878 https://api.github.com/repos/pydata/xarray/issues/3701 MDEyOklzc3VlQ29tbWVudDU3NTczNzg3OA== keewis 14808389 2020-01-17T18:17:59Z 2020-01-17T18:18:08Z MEMBER

here's the dask issue about np.percentile's missing axis parameter: dask/dask#2824

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Error using reduce(): percentile() got an unexpected keyword argument 'axis' 551344538
575671803 https://github.com/pydata/xarray/issues/3701#issuecomment-575671803 https://api.github.com/repos/pydata/xarray/issues/3701 MDEyOklzc3VlQ29tbWVudDU3NTY3MTgwMw== keewis 14808389 2020-01-17T15:27:39Z 2020-01-17T15:27:39Z MEMBER

that would work if we would be working with variables, but Dataset.quantile does a lot more that I didn't want to copy.

We should issue a release soon though.

I agree

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Error using reduce(): percentile() got an unexpected keyword argument 'axis' 551344538
575599184 https://github.com/pydata/xarray/issues/3701#issuecomment-575599184 https://api.github.com/repos/pydata/xarray/issues/3701 MDEyOklzc3VlQ29tbWVudDU3NTU5OTE4NA== keewis 14808389 2020-01-17T12:01:18Z 2020-01-17T12:23:57Z MEMBER

sorry, my mistake. I've been testing on master which has #3559 merged and thus works with dask arrays. Unless someone has a better idea, I'd suggest copying that approach for now: using apply_ufunc to apply np.nanpercentile. ~~Ideally, that would change the quantile call to~~ python percentiles = quantile(ds, q=percentile / 100, dim="time") ~~I'll try to write a working quantile function.~~ Edit: see below, with that you should be able to use python ds.quantile(...)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Error using reduce(): percentile() got an unexpected keyword argument 'axis' 551344538
575605008 https://github.com/pydata/xarray/issues/3701#issuecomment-575605008 https://api.github.com/repos/pydata/xarray/issues/3701 MDEyOklzc3VlQ29tbWVudDU3NTYwNTAwOA== keewis 14808389 2020-01-17T12:21:30Z 2020-01-17T12:22:25Z MEMBER

This ```python def quantile(self, q, dim=None, interpolation="linear", keep_attrs=None): from xarray.core.computation import apply_ufunc from xarray.core import utils

scalar = utils.is_scalar(q) 
q = np.atleast_1d(np.asarray(q, dtype=np.float64)) 
if dim is None: 
    dim = self.dims

if utils.is_scalar(dim): 
    dim = [dim]

def _wrapper(npa, **kwargs): 
    # move quantile axis to end. required for apply_ufunc 
    return np.moveaxis(np.nanpercentile(npa, **kwargs), 0, -1)

axis = np.arange(-1, -1 * len(dim) - 1, -1) 
result = apply_ufunc( 
    _wrapper, 
    self, 
    input_core_dims=[dim], 
    exclude_dims=set(dim), 
    output_core_dims=[["quantile"]], 
    output_dtypes=[np.float64], 
    output_sizes={"quantile": len(q)}, 
    dask="parallelized", 
    kwargs={"q": q * 100, "axis": axis, "interpolation": interpolation}, 
)

# for backward compatibility 
result = result.transpose("quantile", ...) 
if scalar: 
    result = result.squeeze("quantile") 
if keep_attrs: 
    result.attrs = self._attrs

return result

xr.Variable.quantile = quantile `` seems to makequantile` work, but it might be a bad idea to monkeypatch. Thoughts, @dcherian?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Error using reduce(): percentile() got an unexpected keyword argument 'axis' 551344538
575593711 https://github.com/pydata/xarray/issues/3701#issuecomment-575593711 https://api.github.com/repos/pydata/xarray/issues/3701 MDEyOklzc3VlQ29tbWVudDU3NTU5MzcxMQ== keewis 14808389 2020-01-17T11:42:38Z 2020-01-17T11:49:51Z MEMBER

you should be able to just use quantile. I called compute to demonstrate it returns the same values as np.percentile, but you don't need it with quantile.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Error using reduce(): percentile() got an unexpected keyword argument 'axis' 551344538
575590320 https://github.com/pydata/xarray/issues/3701#issuecomment-575590320 https://api.github.com/repos/pydata/xarray/issues/3701 MDEyOklzc3VlQ29tbWVudDU3NTU5MDMyMA== keewis 14808389 2020-01-17T11:31:27Z 2020-01-17T11:31:27Z MEMBER

the reason for this is that the percentile implementation of dask arrays does not support axis. I think you can achieve the same thing by either using compute() (which is probably not desirable) or by using quantile: python In [13]: # Get the percentiles at each lat/lon: ...: ds = ds.compute() ...: percentiles = ds.reduce(np.percentile, q=percentile, dim='time') ...: quantiles = ds.quantile(q=percentile / 100, dim="time") ...: xr.testing.assert_identical(percentiles.drop_vars("height"), quantiles.drop_vars("quantile")) the only difference is that the unused coordinate height disappears and a quantile dimension is added.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Error using reduce(): percentile() got an unexpected keyword argument 'axis' 551344538

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 92.783ms · About: xarray-datasette