issues: 587735698
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
587735698 | MDU6SXNzdWU1ODc3MzU2OTg= | 3890 | error for apply_ufunc with exclude_dims and vectorize | 10194086 | closed | 0 | 2 | 2020-03-25T14:26:36Z | 2020-08-24T13:37:49Z | 2020-08-24T13:37:49Z | MEMBER | I tried to use MCVE Code Sample```python import xarray as xr import scipy as sp import scipy.stats import numpy as np create dataarrays of unequal lengthds = xr.tutorial.open_dataset("air_temperature") da1 = ds.air da2 = ds.air.isel(time=slice(None, 50)) function that takes arguments of unequal length and requires vectorizingdef mannwhitneyu(x, y): _, p = sp.stats.mannwhitneyu(x, y) return p test that the function takes arguments of unequal lengthmannwhitneyu(da1.isel(lat=0, lon=0), da2.isel(lat=0, lon=0)) xr.apply_ufunc( mannwhitneyu, da1, da2, input_core_dims=[["time"], ["time"]], exclude_dims=set(["time"]), vectorize=True, ) ``` Returns
Expected OutputA DataArray. Problem DescriptionI can reproduce the problem in pure numpy:
The correct result is returned when the VersionsOutput of `xr.show_versions()`This is my development environment, so i think xarray should be 'master'. **PNC:/home/mathause/conda/envs/xarray_devel/lib/python3.7/site-packages/PseudoNetCDF/pncwarn.py:24:UserWarning: pyproj could not be found, so IO/API coordinates cannot be converted to lat/lon; to fix, install pyproj or basemap (e.g., `pip install pyproj)` INSTALLED VERSIONS ------------------ commit: None python: 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 21:52:21) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.15.0-91-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.1 xarray: 0.11.1+335.gb0c336f6 pandas: 0.25.3 numpy: 1.17.3 scipy: 1.3.1 netCDF4: 1.5.3 pydap: installed h5netcdf: 0.7.4 h5py: 2.10.0 Nio: None zarr: 2.3.2 cftime: 1.0.4.2 nc_time_axis: None PseudoNetCDF: installed rasterio: 1.1.0 cfgrib: 0.9.5.4 iris: None bottleneck: 1.2.1 dask: 2.6.0 distributed: 2.6.0 matplotlib: 3.1.2 cartopy: None seaborn: 0.9.0 numbagg: None setuptools: 41.6.0.post20191101 pip: 19.3.1 conda: installed pytest: 5.2.2 IPython: 7.9.0 sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3890/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |