home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 354535284

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
354535284 MDU6SXNzdWUzNTQ1MzUyODQ= 2385 Resample with default argument 81219 open 0     6 2018-08-28T01:24:54Z 2023-09-27T08:42:26Z   CONTRIBUTOR      

Code Sample, a copy-pastable example if possible

```python time = pd.date_range('2000-01-01', freq='D', periods=365 * 3) ds = xr.Dataset({'foo': ('time', np.arange(365 * 3)), 'time': time}) ds.foo.resample(time=None)


TypeError Traceback (most recent call last) <ipython-input-34-d7109c181d10> in <module>() ----> 1 ds.foo.resample(time=None)

/home/david/src/anaconda3/lib/python2.7/site-packages/xarray/core/common.pyc in resample(self, freq, dim, how, skipna, closed, label, base, keep_attrs, **indexer) 678 "was passed %r" % dim) 679 group = DataArray(dim, [(dim.dims, dim)], name=RESAMPLE_DIM) --> 680 grouper = pd.Grouper(freq=freq, closed=closed, label=label, base=base) 681 resampler = self._resample_cls(self, group=group, dim=dim_name, 682 grouper=grouper,

TypeError: init() got an unexpected keyword argument 'base' ```

Problem description

Although None is the default value (0v.10.6) for freq, actually using None as the freq raises an error.

Expected Output

I would like resample(time=None) to return ds.foo itself, or a DataArrayResample instance that includes the entire array.

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 2.7.14.final.0 python-bits: 64 OS: Linux OS-release: 4.15.0-30-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_CA.UTF-8 LOCALE: None.None xarray: 0.10.6 pandas: 0.23.0 numpy: 1.14.3 scipy: 1.0.0 netCDF4: 1.3.1 h5netcdf: 0.5.1 h5py: 2.8.0 Nio: None zarr: None bottleneck: 1.2.1 cyordereddict: 1.0.0 dask: 0.17.5 distributed: 1.21.8 matplotlib: 2.2.2 cartopy: None seaborn: 0.8.1 setuptools: 39.2.0 pip: 9.0.3 conda: 4.4.11 pytest: 3.6.0 IPython: 5.7.0 sphinx: 1.7.4
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2385/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

  • 3 rows from issues_id in issues_labels
  • 0 rows from issue in issue_comments
Powered by Datasette · Queries took 0.705ms · About: xarray-datasette