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 778123296,MDExOlB1bGxSZXF1ZXN0NTQ4MjY4ODg5,4762,Print number of variables in repr,14371165,closed,0,,,6,2021-01-04T14:13:17Z,2021-05-18T18:17:50Z,2021-01-12T00:21:19Z,MEMBER,,0,pydata/xarray/pulls/4762,"Show the printed and total number of variables in the repr. - [x] Passes `isort . && black . && mypy . && flake8` ```python import numpy as np import xarray as xr a = np.arange(0, 15) b = np.core.defchararray.add(""long_variable_name"", a.astype(str)) c = np.arange(0, 25) d = np.core.defchararray.add(""attr_"", c.astype(str)) e = {k: 2 for k in d} coords = dict(time=da.array([0, 1])) data_vars = dict() for v in b: data_vars[v] = xr.DataArray( name=v, data=np.array([0, 1]).astype(bool), dims=[""time""], coords=coords, ) ds1 = xr.Dataset(data_vars) ds1.attrs = e # The repr now shows how many attributes in total there are: print(ds1) Out[10]: Dimensions: (time: 2) Coordinates: * time (time) int32 0 1 Data variables: (12/15) long_variable_name0 (time) bool False True long_variable_name1 (time) bool False True long_variable_name2 (time) bool False True long_variable_name3 (time) bool False True long_variable_name4 (time) bool False True long_variable_name5 (time) bool False True ... long_variable_name9 (time) bool False True long_variable_name10 (time) bool False True long_variable_name11 (time) bool False True long_variable_name12 (time) bool False True long_variable_name13 (time) bool False True long_variable_name14 (time) bool False True Attributes: (12/25) attr_0: 2 attr_1: 2 attr_2: 2 attr_3: 2 attr_4: 2 attr_5: 2 ... attr_19: 2 attr_20: 2 attr_21: 2 attr_22: 2 attr_23: 2 attr_24: 2 ```","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4762/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 778083748,MDU6SXNzdWU3NzgwODM3NDg=,4761,Dataset.interp drops boolean variables,14371165,closed,0,,,0,2021-01-04T13:09:56Z,2021-05-13T15:28:15Z,2021-05-13T15:28:15Z,MEMBER,,,," **What happened**: `Dataset.interp` silently drops boolean variables. **What you expected to happen**: If I'm interpolating a group of variables I expect to get all of them back in the correct shape with relevant values in them. If the variables are boolean or object arrays I don't expect it to do linear interpolation because it doesn't make sense but stepwise interpolation like nearest or zero order interpolation should be fine to expect. **Minimal Complete Verifiable Example**: ```python import numpy as np a = np.arange(0, 5) b = np.core.defchararray.add(""long_variable_name"", a.astype(str)) coords = dict(time=da.array([0, 1])) data_vars = dict() for v in b: data_vars[v] = xr.DataArray( name=v, data=np.array([0, 1]).astype(bool), dims=[""time""], coords=coords, ) ds1 = xr.Dataset(data_vars) # Print raw data: print(ds1) Out[3]: Dimensions: (time: 2) Coordinates: * time (time) int32 0 1 Data variables: long_variable_name0 (time) bool False True long_variable_name1 (time) bool False True long_variable_name2 (time) bool False True long_variable_name3 (time) bool False True long_variable_name4 (time) bool False True # Interpolate: ds1 = ds1.interp( time=da.array([0, 0.5, 1, 2]), assume_sorted=True, method=""nearest"", kwargs=dict(fill_value=""extrapolate""), ) # Print interpolated data: Dimensions: (time: 4) Coordinates: * time (time) float64 0.0 0.5 1.0 2.0 Data variables: *empty* ``` **Anything else we need to know?**: `ds.interp_like `use `ds.reindex` in these cases which seems like a good choice in `ds.interp` as well. But I think that both `ds.interp` and `ds.interp_like` should fill by default with nearest value instead of np.nan because we're still requesting interpolation. **Environment**:
Output of xr.show_versions() xr.show_versions() INSTALLED VERSIONS ------------------ commit: None python: 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows libhdf5: 1.10.4 libnetcdf: None xarray: 0.16.2 pandas: 1.1.5 numpy: 1.17.5 scipy: 1.4.1 netCDF4: None pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2020.12.0 distributed: 2020.12.0 matplotlib: 3.3.2 cartopy: None seaborn: 0.11.1 numbagg: None pint: None setuptools: 51.0.0.post20201207 pip: 20.3.3 conda: 4.9.2 pytest: 6.2.1 IPython: 7.19.0 sphinx: 3.4.0
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4761/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue