converting int vars to floats when I where the enclosing ds?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
Code Sample
test_ds = xr.Dataset()
test_ds['var1'] = xr.DataArray(np.arange(5))
test_ds['var2'] = xr.DataArray(np.ones(5))
assert(test_ds['var1'].dtype == np.int64)
assert(test_ds.where(test_ds['var2'] == 1)['var1'].dtype == np.int64)
Problem description
Second assert fails, which is a bit strange I think. Is that intended? If so, whats the reasoning?
Output of xr.show_versions()
xarray: 0.10.3
pandas: 0.22.0
numpy: 1.14.3
scipy: 1.1.0
netCDF4: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
bottleneck: 1.2.1
cyordereddict: None
dask: None
distributed: None
matplotlib: 2.2.2
cartopy: None
seaborn: 0.8.1
setuptools: 39.1.0
pip: 10.0.1
conda: None
pytest: 3.5.1
IPython: 5.6.0
sphinx: None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided Dataset.where reproducer against the current test suite and trace the Dataset.where implementation. Determine whether the dtype change is expected, then add a regression test documenting the intended dtype behavior and update the implementation or documentation accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100