issues
23 rows where type = "issue" and user = 30388627 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: locked, comments, created_at (date), updated_at (date), closed_at (date)
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1037814301 | I_kwDOAMm_X84928od | 5901 | Spurious lines of the pcolormesh example | zxdawn 30388627 | closed | 0 | 9 | 2021-10-27T20:06:40Z | 2024-02-28T19:11:34Z | 2024-02-28T19:11:34Z | NONE | What happened:
The example of plotting data using pcolormesh has some spurious lines:
What you expected to happen: No spurious lines. Minimal Complete Verifiable Example: ```python %matplotlib inline import numpy as np import pandas as pd import xarray as xr import cartopy.crs as ccrs from matplotlib import pyplot as plt ds = xr.tutorial.open_dataset('rasm').load() plt.figure(figsize=(14,6)) ax = plt.axes(projection=ccrs.PlateCarree()) ax.set_global() ds.Tair[0].plot.pcolormesh(ax=ax, transform=ccrs.PlateCarree(), x='xc', y='yc', shading='auto', add_colorbar=False) ax.coastlines() ax.set_ylim([0,90]); ``` Anything else we need to know?: pcolormesh doc Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.8.10 | packaged by conda-forge | (default, Sep 13 2021, 21:46:58) [GCC 9.4.0] python-bits: 64 OS: Linux OS-release: 5.11.0-34-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.12.1 libnetcdf: 4.8.1 xarray: 0.19.0 pandas: 1.3.3 numpy: 1.21.2 scipy: 1.7.1 netCDF4: 1.5.7 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.5.1 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2021.10.0 distributed: 2021.10.0 matplotlib: 3.4.3 cartopy: 0.19.0.post1 seaborn: None numbagg: None pint: None setuptools: 58.0.4 pip: 21.2.4 conda: None pytest: None IPython: 7.28.0 sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5901/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1943355490 | I_kwDOAMm_X85z1UBi | 8308 | Different plotting reaults compared to matplotlib | zxdawn 30388627 | closed | 0 | 4 | 2023-10-14T15:54:32Z | 2023-10-14T20:02:16Z | 2023-10-14T20:02:16Z | NONE | What happened?I got different results when I tried to plot 2D data test.npy.zip using matplotlib and xarray. matplotlibxarrayWhat did you expect to happen?Same plot. Minimal Complete Verifiable Example```Python import numpy as np import xarray as xr import matplotlib.pyplot as plt test = np.load('test.npy') plt.imshow(test, vmin=0, vmax=200) plt.colorbar() xr.DataArray(test).plot.imshow(vmin=0, vmax=200) ``` MVCE confirmation
Relevant log outputNo response Anything else we need to know?No response Environment
INSTALLED VERSIONS
------------------
commit: None
python: 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:41:52) [Clang 15.0.7 ]
python-bits: 64
OS: Darwin
OS-release: 22.3.0
machine: arm64
processor: arm
byteorder: little
LC_ALL: None
LANG: None
LOCALE: (None, 'UTF-8')
libhdf5: None
libnetcdf: None
xarray: 2023.9.0
pandas: 2.1.1
numpy: 1.26.0
scipy: None
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: None
nc_time_axis: None
PseudoNetCDF: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: 3.8.0
cartopy: None
seaborn: None
numbagg: None
fsspec: None
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 68.2.2
pip: 23.2.1
conda: None
pytest: None
mypy: None
IPython: 8.16.1
sphinx: None
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/8308/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1279891109 | I_kwDOAMm_X85MSZal | 6713 | Support `skipna` in `.where()` | zxdawn 30388627 | closed | 0 | 3 | 2022-06-22T10:04:05Z | 2022-06-24T22:52:02Z | 2022-06-24T22:52:02Z | NONE | Is your feature request related to a problem?Sometimes, the mask used in Describe the solution you'd likeThis option can be achieved by adding if Describe alternatives you've consideredNo response Additional contextNo response |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6713/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
596249070 | MDU6SXNzdWU1OTYyNDkwNzA= | 3954 | Concatenate 3D array with 2D array | zxdawn 30388627 | open | 0 | 5 | 2020-04-08T01:36:28Z | 2022-05-06T16:39:22Z | NONE | The 3D array has three dims: z, y and x.
The 2D array has two dims: y and x.
When I try to concatenate them by expanding the 2D array with z dim, there's something wrong in MCVE Code Sample```python import xarray as xr import numpy as np x = 2 y = 4 z = 3 data = np.arange(xyz).reshape(z, x, y) 3d array with coordsa = xr.DataArray(data, dims=['z', 'y', 'x'], coords={'z': np.arange(z)}) 2d array without coordsb = xr.DataArray(np.arange(xy).reshape(x, y)1.5, dims=['y', 'x']) expand 2d to 3db = b.expand_dims('z') concatcomb = xr.concat([a, b], dim='z') ``` Expected OutputSame as ``` <xarray.DataArray (z: 4, x: 2, y: 4)> array([[[ 0. , 1. , 2. , 3. ], [ 4. , 5. , 6. , 7. ]],
Dimensions without coordinates: z, x, y ``` Problem Description
As suggested by @dcherian, assigning the coordinate label by changing VersionsOutput of `xr.show_versions()`INSTALLED VERSIONS ------------------ commit: None python: 3.7.6 | packaged by conda-forge | (default, Jan 7 2020, 21:48:41) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: None.None libhdf5: None libnetcdf: None xarray: 0.15.1 pandas: 1.0.3 numpy: 1.18.1 scipy: 1.4.1 netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.1.1.2 nc_time_axis: None PseudoNetCDF: None rasterio: 1.1.3 cfgrib: None iris: None bottleneck: None dask: 2.10.1 distributed: 2.14.0 matplotlib: 3.2.1 cartopy: 0.17.0 seaborn: 0.10.0 numbagg: None setuptools: 46.1.3.post20200325 pip: 20.0.2 conda: None pytest: None IPython: 7.13.0 sphinx: 2.4.4 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3954/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
596352097 | MDU6SXNzdWU1OTYzNTIwOTc= | 3955 | Masking and preserving int type | zxdawn 30388627 | closed | 0 | 5 | 2020-04-08T06:56:26Z | 2022-05-02T19:25:42Z | 2022-05-02T19:25:42Z | NONE | When DataArray is masked by But, if we need to use the DataArray ouput from MCVE Code Sample```python import numpy as np import xarray as xr val_arr = xr.DataArray(np.arange(27).reshape(3, 3, 3), dims=['z', 'y', 'x']) z_indices = xr.DataArray(np.array([[1, 0, 2], [0, 0, 1], [-2222, 0, 1]]), dims=['y', 'x']) fill_value = -2222 sub = z_indices.where(z_indices != fill_value) indexed_array = val_arr.isel(z=sub) ``` Expected Output
Problem Description
Currently, pandas supports NaN values. Is this possible for xarray? or another method around? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3955/reactions", "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 1, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
630573329 | MDU6SXNzdWU2MzA1NzMzMjk= | 4121 | decode_cf doesn't work for ancillary_variables in attributes | zxdawn 30388627 | closed | 0 | 4 | 2020-06-04T07:18:34Z | 2022-04-18T15:56:22Z | 2022-04-18T15:56:22Z | NONE | Sometimes we have one attribute called MCVE Code Sample```python import numpy as np import xarray as xr import pandas as pd temp = 15 + 8 * np.random.randn(2, 2, 3) precip = 10 * np.random.rand(2, 2, 3) temp = xr.DataArray(temp, dims=['x', 'y', 'time']) precip = xr.DataArray(precip, dims=['x', 'y', 'time']) lon = [[-99.83, -99.32], [-99.79, -99.23]] lat = [[42.25, 42.21], [42.63, 42.59]] temp.attrs['ancillary_variables'] = ['precip'] precip.attrs['ancillary_variables'] = ['temp'] ds = xr.Dataset({'temperature': temp, 'precipitation': precip}, coords={'lon': (['x', 'y'], lon), 'lat': (['x', 'y'], lat), 'time': pd.date_range('2014-09-06', periods=3), 'reference_time': pd.Timestamp('2014-09-05')}) ds.to_netcdf('test_ancillary_variables.nc', engine='netcdf4') ds_new = xr.open_dataset('test_ancillary_variables.nc', decode_cf=True) print(ds_new['temperature']) ``` Expected Output
VersionsOutput of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.7.6 | packaged by conda-forge | (default, Mar 23 2020, 23:03:20) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.9.0-8-amd64 machine: x86_64 processor: byteorder: little LC_ALL: None LANG: en_US.utf8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.1 pandas: 1.0.4 numpy: 1.18.4 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: 2.4.0 cftime: 1.1.3 nc_time_axis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: None dask: 2.14.0 distributed: 2.17.0 matplotlib: 3.2.1 cartopy: 0.18.0 seaborn: None numbagg: None setuptools: 47.1.1.post20200529 pip: 20.1.1 conda: None pytest: None IPython: None sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4121/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
596606599 | MDU6SXNzdWU1OTY2MDY1OTk= | 3957 | Sort DataArray by data values along one dim | zxdawn 30388627 | closed | 0 | 10 | 2020-04-08T14:05:44Z | 2022-04-09T15:52:20Z | 2022-04-09T15:52:20Z | NONE |
MCVE Code Sample```python import xarray as xr import numpy as np x = 4 y = 2 z = 4 data = np.arange(xyz).reshape(z, y, x) 3d array with coordscld_1 = xr.DataArray(data, dims=['z', 'y', 'x'], coords={'z': np.arange(z)}) 2d array without coordscld_2 = xr.DataArray(np.arange(xy).reshape(y, x)1.5+1, dims=['y', 'x']) expand 2d to 3dcld_2 = cld_2.expand_dims(z=[4]) concatcld = xr.concat([cld_1, cld_2], dim='z') paired arraypair = cld.copy(data=np.arange(xy(z+1)).reshape(z+1, y, x)) print(cld) print(pair) ``` Output``` <xarray.DataArray (z: 5, y: 2, x: 4)> array([[[ 0. , 1. , 2. , 3. ], [ 4. , 5. , 6. , 7. ]],
Coordinates: * z (z) int64 0 1 2 3 4 Dimensions without coordinates: y, x <xarray.DataArray (z: 5, y: 2, x: 4)> array([[[ 0, 1, 2, 3], [ 4, 5, 6, 7]],
Coordinates: * z (z) int64 0 1 2 3 4 Dimensions without coordinates: y, x ``` Problem DescriptionI've tried
Coordinates: * z (z) int64 0 1 2 3 4 Dimensions without coordinates: y, x ``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3957/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1112925311 | I_kwDOAMm_X85CVeR_ | 6188 | extrapolate not working for multi-dimentional data | zxdawn 30388627 | closed | 1 | 2 | 2022-01-24T17:16:20Z | 2022-01-24T22:34:08Z | 2022-01-24T22:27:48Z | NONE | What happened?I'm trying to interpolate multi-dimensional data. But, it doesn't work with extrapolating. What did you expect to happen?No response Minimal Complete Verifiable Example```python import xarray as xr import numpy as np da = xr.DataArray( np.sin(0.3 * np.arange(20).reshape(5, 4)), [("x", np.arange(5)), ("y", [0.1, 0.2, 0.3, 0.4])], ) x = xr.DataArray([-0.5, 1.5, 2.5], dims="z") y = xr.DataArray([0.15, 0.25, 0.35], dims="z") da.interp(x=x, y=y, kwargs={"fill_value": "extrapolate"}) ``` Relevant log output```pythonValueError Traceback (most recent call last) Input In [2], in <module> 8 x = xr.DataArray([-0.5, 1.5, 2.5], dims="z") 10 y = xr.DataArray([0.15, 0.25, 0.35], dims="z") ---> 12 da.interp(x=x, y=y, kwargs={"fill_value": "extrapolate"}) File ~/miniconda3/lib/python3.9/site-packages/xarray/core/dataarray.py:1742, in DataArray.interp(self, coords, method, assume_sorted, kwargs, coords_kwargs) 1737 if self.dtype.kind not in "uifc": 1738 raise TypeError( 1739 "interp only works for a numeric type array. " 1740 "Given {}.".format(self.dtype) 1741 ) -> 1742 ds = self._to_temp_dataset().interp( 1743 coords, 1744 method=method, 1745 kwargs=kwargs, 1746 assume_sorted=assume_sorted, 1747 coords_kwargs, 1748 ) 1749 return self._from_temp_dataset(ds) File ~/miniconda3/lib/python3.9/site-packages/xarray/core/dataset.py:3192, in Dataset.interp(self, coords, method, assume_sorted, kwargs, method_non_numeric, coords_kwargs) 3189 if dtype_kind in "uifc": 3190 # For normal number types do the interpolation: 3191 var_indexers = {k: v for k, v in use_indexers.items() if k in var.dims} -> 3192 variables[name] = missing.interp(var, var_indexers, method, kwargs) 3193 elif dtype_kind in "ObU" and (use_indexers.keys() & var.dims): 3194 # For types that we do not understand do stepwise 3195 # interpolation to avoid modifying the elements. (...) 3198 # this loop there might be some duplicate code that slows it 3199 # down, therefore collect these signals and run it later: 3200 to_reindex[name] = var File ~/miniconda3/lib/python3.9/site-packages/xarray/core/missing.py:640, in interp(var, indexes_coords, method, *kwargs) 638 original_dims = broadcast_dims + dims 639 new_dims = broadcast_dims + list(destination[0].dims) --> 640 interped = interp_func( 641 var.transpose(original_dims).data, x, destination, method, kwargs 642 ) 644 result = Variable(new_dims, interped, attrs=var.attrs) 646 # dimension of the output array File ~/miniconda3/lib/python3.9/site-packages/xarray/core/missing.py:765, in interp_func(var, x, new_x, method, kwargs) 749 meta = var._meta 751 return da.blockwise( 752 _dask_aware_interpnd, 753 out_ind, (...) 762 align_arrays=False, 763 ) --> 765 return _interpnd(var, x, new_x, func, kwargs) File ~/miniconda3/lib/python3.9/site-packages/xarray/core/missing.py:789, in _interpnd(var, x, new_x, func, kwargs) 787 # stack new_x to 1 vector, with reshape 788 xi = np.stack([x1.values.ravel() for x1 in new_x], axis=-1) --> 789 rslt = func(x, var, xi, **kwargs) 790 # move back the interpolation axes to the last position 791 rslt = rslt.transpose(range(-rslt.ndim + 1, 1)) File ~/miniconda3/lib/python3.9/site-packages/scipy/interpolate/interpolate.py:2703, in interpn(points, values, xi, method, bounds_error, fill_value) 2701 # perform interpolation 2702 if method == "linear": -> 2703 interp = RegularGridInterpolator(points, values, method="linear", 2704 bounds_error=bounds_error, 2705 fill_value=fill_value) 2706 return interp(xi) 2707 elif method == "nearest": File ~/miniconda3/lib/python3.9/site-packages/scipy/interpolate/interpolate.py:2469, in RegularGridInterpolator.init(self, points, values, method, bounds_error, fill_value) 2465 fill_value_dtype = np.asarray(fill_value).dtype 2466 if (hasattr(values, 'dtype') and not 2467 np.can_cast(fill_value_dtype, values.dtype, 2468 casting='same_kind')): -> 2469 raise ValueError("fill_value must be either 'None' or " 2470 "of a type compatible with values") 2472 for i, p in enumerate(points): 2473 if not np.all(np.diff(p) > 0.): ValueError: fill_value must be either 'None' or of a type compatible with values ``` Anything else we need to know?I've also tried KeyError Traceback (most recent call last) Input In [4], in <module> 10 y = xr.DataArray([0.15, 0.25, 0.35], dims="z") 12 # da.interp(x=x, y=y, kwargs={"fill_value": "extrapolate"}) ---> 13 da.interp(x=x, kwargs={"fill_value": "extrapolate"}).interp(y=y) File ~/miniconda3/lib/python3.9/site-packages/xarray/core/dataarray.py:1742, in DataArray.interp(self, coords, method, assume_sorted, kwargs, coords_kwargs) 1737 if self.dtype.kind not in "uifc": 1738 raise TypeError( 1739 "interp only works for a numeric type array. " 1740 "Given {}.".format(self.dtype) 1741 ) -> 1742 ds = self._to_temp_dataset().interp( 1743 coords, 1744 method=method, 1745 kwargs=kwargs, 1746 assume_sorted=assume_sorted, 1747 coords_kwargs, 1748 ) 1749 return self._from_temp_dataset(ds) File ~/miniconda3/lib/python3.9/site-packages/xarray/core/dataset.py:3130, in Dataset.interp(self, coords, method, assume_sorted, kwargs, method_non_numeric, *coords_kwargs) 3121 if coords: 3122 # This avoids broadcasting over coordinates that are both in 3123 # the original array AND in the indexing array. It essentially 3124 # forces interpolation along the shared coordinates. 3125 sdims = ( 3126 set(self.dims) 3127 .intersection([set(nx.dims) for nx in indexers.values()]) 3128 .difference(coords.keys()) 3129 ) -> 3130 indexers.update({d: self.variables[d] for d in sdims}) 3132 obj = self if assume_sorted else self.sortby([k for k in coords]) 3134 def maybe_variable(obj, k): 3135 # workaround to get variable for dimension without coordinate. File ~/miniconda3/lib/python3.9/site-packages/xarray/core/dataset.py:3130, in <dictcomp>(.0) 3121 if coords: 3122 # This avoids broadcasting over coordinates that are both in 3123 # the original array AND in the indexing array. It essentially 3124 # forces interpolation along the shared coordinates. 3125 sdims = ( 3126 set(self.dims) 3127 .intersection(*[set(nx.dims) for nx in indexers.values()]) 3128 .difference(coords.keys()) 3129 ) -> 3130 indexers.update({d: self.variables[d] for d in sdims}) 3132 obj = self if assume_sorted else self.sortby([k for k in coords]) 3134 def maybe_variable(obj, k): 3135 # workaround to get variable for dimension without coordinate. File ~/miniconda3/lib/python3.9/site-packages/xarray/core/utils.py:459, in Frozen.getitem(self, key) 458 def getitem(self, key: K) -> V: --> 459 return self.mapping[key] KeyError: 'z' ``` Environment```python INSTALLED VERSIONS commit: None python: 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:20:46) [GCC 9.4.0] python-bits: 64 OS: Linux OS-release: 5.11.0-40-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.12.1 libnetcdf: 4.8.1 xarray: 0.20.2 pandas: 1.3.5 numpy: 1.19.5 scipy: 1.7.3 netCDF4: 1.5.8 pydap: None h5netcdf: None h5py: 3.6.0 Nio: None zarr: 2.10.3 cftime: 1.5.1.1 nc_time_axis: None PseudoNetCDF: None rasterio: 1.2.10 cfgrib: None iris: None bottleneck: None dask: 2021.12.0 distributed: 2021.12.0 matplotlib: 3.5.1 cartopy: 0.20.2 seaborn: None numbagg: None fsspec: 2022.01.0 cupy: None pint: 0.18 sparse: None setuptools: 59.8.0 pip: 21.3.1 conda: 4.11.0 pytest: None IPython: 8.0.0 sphinx: None ``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6188/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1085619598 | I_kwDOAMm_X85AtT2O | 6091 | uint type data are read as wrong type (float64) | zxdawn 30388627 | closed | 0 | 3 | 2021-12-21T09:29:10Z | 2022-01-09T03:30:55Z | 2022-01-09T03:30:55Z | NONE | What happened: The Minimal Complete Verifiable Example: ```python import xarray as xr print(xr.open_dataset('test_save.nc')['processing_quality_flags'].dtype) ``` Anything else we need to know?: The sample data is attached here.
The output of Note that I can't reproduce it using this example: ``` import numpy as np import xarray as xr da = xr.DataArray(np.array([1,2,3], dtype='uint')).rename('test_array') da.to_netcdf("test.nc", engine='netcdf4') with xr.open_dataset('test.nc') as ds: print(ds['test_array'].dtype)
Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:20:46) [GCC 9.4.0] python-bits: 64 OS: Linux OS-release: 5.11.0-40-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.12.1 libnetcdf: 4.8.1 xarray: 0.20.1 pandas: 1.3.4 numpy: 1.20.3 scipy: 1.7.3 netCDF4: 1.5.8 pydap: None h5netcdf: None h5py: 3.6.0 Nio: None zarr: 2.10.3 cftime: 1.5.1.1 nc_time_axis: None PseudoNetCDF: None rasterio: 1.2.10 cfgrib: None iris: None bottleneck: None dask: 2021.11.2 distributed: 2021.11.2 matplotlib: 3.5.0 cartopy: 0.20.1 seaborn: None numbagg: None fsspec: 2021.11.1 cupy: None pint: 0.18 sparse: None setuptools: 59.4.0 pip: 21.3.1 conda: 4.11.0 pytest: None IPython: 7.30.0 sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6091/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1083806365 | I_kwDOAMm_X85AmZKd | 6085 | Missing linked coordinates of subgroup variable | zxdawn 30388627 | closed | 0 | 3 | 2021-12-18T10:55:56Z | 2021-12-27T18:30:59Z | 2021-12-27T18:30:59Z | NONE | What happened: I have a NetCDF file that has groups like this:
Screenshots When I read the variable named What you expected to happen: Coordinates of variables in subgroups are loaded. Minimal Complete Verifiable Example:
Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:20:46) [GCC 9.4.0] python-bits: 64 OS: Linux OS-release: 5.11.0-40-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.12.1 libnetcdf: 4.8.1 xarray: 0.20.1 pandas: 1.3.4 numpy: 1.20.3 scipy: 1.7.3 netCDF4: 1.5.8 pydap: None h5netcdf: None h5py: 3.6.0 Nio: None zarr: 2.10.3 cftime: 1.5.1.1 nc_time_axis: None PseudoNetCDF: None rasterio: 1.2.10 cfgrib: None iris: None bottleneck: None dask: 2021.11.2 distributed: 2021.11.2 matplotlib: 3.5.0 cartopy: 0.20.1 seaborn: None numbagg: None fsspec: 2021.11.1 cupy: None pint: 0.18 sparse: None setuptools: 59.4.0 pip: 21.3.1 conda: 4.11.0 pytest: None IPython: 7.30.0 sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6085/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
1086038682 | I_kwDOAMm_X85Au6Ka | 6095 | Issue on page /examples/multidimensional-coords.html | zxdawn 30388627 | open | 0 | 1 | 2021-12-21T17:04:09Z | 2021-12-21T19:17:42Z | NONE | The |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6095/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue | ||||||||
488190500 | MDU6SXNzdWU0ODgxOTA1MDA= | 3275 | Change the label size and tick label size of colorbar | zxdawn 30388627 | closed | 0 | 10 | 2019-09-02T13:27:32Z | 2021-11-17T19:38:25Z | 2019-09-02T13:36:18Z | NONE | MCVE Code Sample```python Your code hereimport xarray as xr airtemps = xr.tutorial.open_dataset('air_temperature') air = airtemps.air - 273.15 air2d = air.isel(time=500) air2d.plot.pcolormesh(add_colorbar=True, add_labels=True, cbar_kwargs=dict(orientation='horizontal', pad=0.15, shrink=1, label='Temperature ($^{\circ}$C)')) ``` Expected OutputProblem DescriptionIs it possible to change the label size and ticks label size of colorbar?
Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3275/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
912149228 | MDU6SXNzdWU5MTIxNDkyMjg= | 5439 | Set `allow_rechunk=True` still raise different lengths error | zxdawn 30388627 | closed | 0 | 1 | 2021-06-05T08:17:18Z | 2021-06-05T08:37:11Z | 2021-06-05T08:34:52Z | NONE | What happened: I'm using Minimal Complete Verifiable Example: ```python import numpy as np import xarray as xr data = xr.DataArray(np.arange(10), dims=['x']) dask_data = data.chunk({'x': -1}) bins_reduceat = np.linspace(0, 9, 10).astype('int') def reduceat_np(data, bins): return np.minimum.reduceat(data, bins) res = xr.apply_ufunc(reduceat_np, dask_data, bins_reduceat[:5], dask="parallelized", output_dtypes=[data.dtype], dask_gufunc_kwargs={'allow_rechunk': True},
res.compute() ``` Error:
ValueError: Dimension Anything else we need to know?: It works well if the data and bin have the same length. Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.8.8 | packaged by conda-forge | (default, Feb 20 2021, 16:22:27) [GCC 9.3.0] python-bits: 64 OS: Linux OS-release: 3.10.0-957.el7.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.18.2 pandas: 1.2.4 numpy: 1.20.2 scipy: 1.6.3 netCDF4: 1.5.6 pydap: None h5netcdf: None h5py: 3.2.1 Nio: None zarr: 2.8.1 cftime: 1.2.1 nc_time_axis: 1.2.0 PseudoNetCDF: None rasterio: 1.2.3 cfgrib: None iris: 3.0.1 bottleneck: None dask: 2021.04.1 distributed: 2021.04.1 matplotlib: 3.3.4 cartopy: 0.19.0.post1 seaborn: None numbagg: None pint: 0.17 setuptools: 49.6.0.post20210108 pip: 21.1.1 conda: None pytest: 6.2.4 IPython: 7.23.1 sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5439/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
897689314 | MDU6SXNzdWU4OTc2ODkzMTQ= | 5358 | Support `range` in `groupby_bins` | zxdawn 30388627 | closed | 0 | 4 | 2021-05-21T05:25:12Z | 2021-05-31T19:10:24Z | 2021-05-21T12:44:39Z | NONE | Although Here's an example: ``` from scipy.stats import binned_statistic import numpy as np import xarray as xr --- scipy method ---x = np.arange(500) values = x*50 statistics, _, _ = binned_statistic(x, values, statistic='min', bins=500, range=(0, 500)) --- xarray method ---x = xr.DataArray(x) values = xr.DataArray(values) x.groupby_bins('dim_0', bins=500).min() ``` I can set |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5358/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
694874737 | MDU6SXNzdWU2OTQ4NzQ3Mzc= | 4410 | interpolate_na doesn't support extrapolation | zxdawn 30388627 | closed | 0 | 4 | 2020-09-07T08:46:50Z | 2020-11-30T17:25:42Z | 2020-11-30T17:25:42Z | NONE | What happened:
What you expected to happen: Support extrapolation. Minimal Complete Verifiable Example: ```python import xarray as xr import numpy as np x = xr.DataArray( [[0, 1, np.nan, np.nan, 2, np.nan, np.nan]], dims=['y', 'x'], coords={"x": xr.Variable("x", [0, 1, 1.1, 1.8, 2, 4, 5]), 'y': xr.Variable("y", [0])}, ) x = x.interpolate_na(dim="x", method="linear", use_coordinate="x") print(x) ``` The output is:
It should be this array after extrapolation:
Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.8.5 | packaged by conda-forge | (default, Jul 24 2020, 01:25:15) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 5.4.0-42-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.6 libnetcdf: 4.7.4 xarray: 0.16.0 pandas: 1.0.5 numpy: 1.19.1 scipy: 1.5.2 netCDF4: 1.5.4 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: 2.4.0 cftime: 1.2.1 nc_time_axis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: None dask: 2.21.0 distributed: 2.21.0 matplotlib: 3.3.0 cartopy: None seaborn: None numbagg: None pint: None setuptools: 49.2.0.post20200712 pip: 20.1.1 conda: None pytest: None IPython: None sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4410/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
609108666 | MDU6SXNzdWU2MDkxMDg2NjY= | 4016 | Concatenate DataArrays on one dim when another dim has difference sizes | zxdawn 30388627 | closed | 0 | 8 | 2020-04-29T14:36:10Z | 2020-05-06T00:54:39Z | 2020-04-30T12:12:11Z | NONE | It's impossible to concatenate two arrays on same named dimensions with different sizes. MCVE Code Sample```python import xarray as xr import pandas as pd a = xr.DataArray([0], dims=['x']) b = xr.DataArray([1, 2, 3], dims=['x']) a = a.expand_dims("time") b = b.expand_dims("time") a.coords["time"] = pd.DatetimeIndex(['2020-02-14 05:25:10']) b.coords["time"] = pd.DatetimeIndex(['2020-02-14 05:25:10']) c = xr.concat([a, b], dim='time') print(c) ``` Expected Output
Problem Description
VersionsOutput of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.7.6 | packaged by conda-forge | (default, Jan 7 2020, 21:48:41) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: None.None libhdf5: 1.10.5 libnetcdf: 4.7.3 xarray: 0.15.1 pandas: 1.0.3 numpy: 1.18.1 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: 2.4.0 cftime: 1.1.1.2 nc_time_axis: None PseudoNetCDF: None rasterio: 1.1.3 cfgrib: None iris: None bottleneck: None dask: 2.10.1 distributed: 2.14.0 matplotlib: 3.2.1 cartopy: 0.17.0 seaborn: 0.10.0 numbagg: None setuptools: 46.1.3.post20200325 pip: 20.0.2 conda: None pytest: None IPython: 7.13.0 sphinx: 2.4.4 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4016/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
595900209 | MDU6SXNzdWU1OTU5MDAyMDk= | 3949 | Index 3D array with index of last axis stored in 2D array | zxdawn 30388627 | closed | 0 | 2 | 2020-04-07T14:13:39Z | 2020-04-07T14:30:12Z | 2020-04-07T14:30:12Z | NONE | This is copied from a question on stackoverflow.
MCVE Code Sample```python import numpy as np val_arr = np.arange(27).reshape(3, 3, 3) z_indices = np.array([[1, 0, 2], [0, 0, 1], [2, 0, 1]]) index_array = z_indices.choose(val_arr) print(index_array) ``` xarray version```python import numpy as np import xarray as xr val_arr = xr.DataArray(np.arange(27).reshape(3, 3, 3), dims=['z', 'y', 'x']) z_indices = xr.DataArray(np.array([[1, 0, 2], [0, 0, 1], [2, 0, 1]]), dims=['y', 'x']) index_array = np.choose(z_indices, val_arr) print(index_array) ``` Expected Output
Problem DescriptionIs this feature of |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3949/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
594900245 | MDU6SXNzdWU1OTQ5MDAyNDU= | 3941 | Sum based on start_index and end_index array | zxdawn 30388627 | closed | 0 | 5 | 2020-04-06T08:15:57Z | 2020-04-07T02:45:26Z | 2020-04-07T02:45:26Z | NONE | I have three arrays:
1. MCVE Code Sample```python import xarray as xr data = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) input arraya = xr.DataArray(data, dims=['x', 'y']) start_index arraysindex = xr.DataArray(np.array([0, 0, 1, 1]), dims=['x']) end_index arrayeindex = xr.DataArray(np.array([0, 1, 2, 2]), dims=['x']) empty array for saving summationsum_a = xr.DataArray(np.empty((a.shape[0], 1)), dims=['x', 'y']) for x in a.x: # sum values from sindex to eindex at row x sum_a[x] = a[x, sindex[x].values:eindex[x].values+1].sum() print(sum_a) ``` Expected Output
Problem DescriptionIs it necessary to use |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3941/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
593770078 | MDU6SXNzdWU1OTM3NzAwNzg= | 3931 | Interpolate 3D array by another 3D array | zxdawn 30388627 | closed | 0 | 10 | 2020-04-04T08:09:07Z | 2020-04-05T01:22:44Z | 2020-04-05T01:22:44Z | NONE | I have two data:
Then, I want to interpolate the first 3D data to another 3D pressure data.
I have to iterate through This is too slow when the 3D array is large. Is there a more efficient and easier method to accomplish this? MCVE Code Sample```python import xarray as xr import numpy as np x = 10 y = 10 z = 4 data = np.arange(xyz).reshape((x, y, z)) bottom_up databottom_up = xr.DataArray(data, coords={'x': np.arange(x), 'y': np.arange(y), 'z': np.arange(z)}, dims=['x', 'y', 'z'] ) corresponding pressure datapressure = xr.DataArray(data+1, coords={'x': np.arange(x), 'y': np.arange(y), 'z': np.arange(z)}, dims=['x', 'y', 'z'] ) pressure levels which data are interpolated tointerp_p = xr.DataArray(data[:, :, :-2]+0.5, coords={'x': np.arange(x), 'y': np.arange(y), 'z': np.arange(z-2)}, dims=['x', 'y', 'z']) empty DataArray where interpolated values are savedoutput = interp_p.copy(data=np.full_like(interp_p, np.nan)) iterate through x and yfor x in bottom_up.x: for y in bottom_up.y: # replace bottom_up with pressure bottom_up = bottom_up.assign_coords(z=(pressure[x, y, :]).values) # interpolate data to interpolated pressure levels output[x, y, :] = bottom_up[x, y, :].interp(z=interp_p[x, y, :], kwargs={'fill_value': 'extrapolate'} ) print(output) ``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3931/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
507658070 | MDU6SXNzdWU1MDc2NTgwNzA= | 3407 | Save 'S1' array without the char_dim_name dimension | zxdawn 30388627 | closed | 0 | 2 | 2019-10-16T07:04:47Z | 2019-10-16T08:55:02Z | 2019-10-16T08:55:01Z | NONE | MCVE Code Sample```python import numpy as np import xarray as xr tstr='2019-07-25_00:00:00' Times = xr.DataArray(np.array([" ".join(tstr).split()], dtype = 'S1'), dims = ['Time', 'DateStrLen']) ds = xr.Dataset({'Times':Times}) ds.to_netcdf('test.nc', format='NETCDF4',encoding={'Times': {'zlib':True, 'complevel':5}}, unlimited_dims={'Time':True}) ``` Expected OutputBecause I want to use the nc file as the input of WRF model,
I just need
``` netcdf test { dimensions: Time = UNLIMITED ; // (1 currently) DateStrLen = 19 ; variables: char Times(Time, DateStrLen) ; }
Problem DescriptionThis is the actual output of Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3407/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
490593787 | MDU6SXNzdWU0OTA1OTM3ODc= | 3290 | Using min() with skipna=True | zxdawn 30388627 | closed | 0 | 8 | 2019-09-07T05:20:54Z | 2019-09-08T02:52:57Z | 2019-09-08T02:52:56Z | NONE | MCVE Code Sample```python from datetime impo rt datetime import xarray as xr import os def read_data(f, composition, west, east, north, south): # read data ds = xr.open_dataset(f, group='PRODUCT') # subset to region index = ((ds.longitude > west) & (ds.longitude < east)) ds = ds.where(index) # read composition data = ds[composition][0,:,:] data_units = data.units # read time t = ds['time_utc'] st = datetime.strptime(str(t.min(skipna=True).values), '%Y-%m-%dT%H:%M:%S.%fZ') et = datetime.strptime(str(t.max(skipna=True).values), '%Y-%m-%dT%H:%M:%S.%fZ')
datadir = '/xin/data/TROPOMI/GZ/bug' os.chdir(datadir) west = 112.5; east = 114.5; north = 24; south = 22.5; f = 'S5P_NRTI_L2__O3_____20190825T053303_20190825T053803_09659_01_010107_20190825T061441.nc' lon, lat, data, data_units, st, et = read_data(f, 'ozone_total_vertical_column', west, east, north, south) ``` Problem DescriptionYou can download the data from google drive.
I get errors shown in details, even using
Traceback (most recent call last):
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/duck_array_ops.py", line 236, in f
return func(values, axis=axis, **kwargs)
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/nanops.py", line 77, in nanmin
'min', dtypes.get_pos_infinity(a.dtype), a, axis)
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/nanops.py", line 69, in _nan_minmax_object
data = dtypes.fill_value(value.dtype) if valid_count == 0 else data
AttributeError: module 'xarray.core.dtypes' has no attribute 'fill_value'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "bug.py", line 31, in <module>
west, east, north, south)
File "bug.py", line 16, in read_data
st = datetime.strptime(str(t.min(skipna=True).values), '%Y-%m-%dT%H:%M:%S.%fZ')
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/common.py", line 25, in wrapped_func
skipna=skipna, allow_lazy=True, **kwargs)
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/dataarray.py", line 1597, in reduce
var = self.variable.reduce(func, dim, axis, keep_attrs, **kwargs)
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/variable.py", line 1354, in reduce
axis=axis, **kwargs)
File "/public/software/anaconda/anaconda3/envs/behr/lib/python3.6/site-packages/xarray-0.11.3-py3.6.egg/xarray/core/duck_array_ops.py", line 249, in f
raise NotImplementedError(msg)
NotImplementedError: min is not available with skipna=False with the installed version of numpy; upgrade to numpy 1.12 or newer to use skipna=True or skipna=None
Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3290/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
405244302 | MDU6SXNzdWU0MDUyNDQzMDI= | 2731 | Can't access variables in the subgroup | zxdawn 30388627 | closed | 0 | 1 | 2019-01-31T13:24:51Z | 2019-01-31T21:57:57Z | 2019-01-31T21:57:57Z | NONE | Code Sample```python import xarray as xr from netCDF4 import Dataset rootgrp = Dataset("test.nc", "w", format="NETCDF4") fcstgrp = rootgrp.createGroup("forecasts") lat = rootgrp.createDimension("lat", 73) lon = rootgrp.createDimension("lon", 144) latitudes = rootgrp.createVariable("lat","f4",("lat",)) longitudes = rootgrp.createVariable("lon","f4",("lon",)) temp = rootgrp.createVariable("temp","f4",("lat","lon",)) ftemp = rootgrp.createVariable("/forecasts/temp","f4","lat","lon",) rootgrp.close() ds = xr.open_dataset('test.nc') print (ds['temp']) print (ds['/forecasts/temp']) ``` Problem descriptionThe Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2731/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue | ||||||
394625579 | MDU6SXNzdWUzOTQ2MjU1Nzk= | 2636 | open_mfdataset change the attributes of Coordinates | zxdawn 30388627 | closed | 0 | 6 | 2018-12-28T12:24:01Z | 2018-12-29T23:47:42Z | 2018-12-29T23:47:42Z | NONE | Code Sample```python import xarray as xr import numpy as np from netCDF4 import Dataset temp = np.random.randn(2, 2, 3) precip = np.random.rand(2, 2, 3) lon = [[-99.83, -99.32], [-99.79, -99.23]] lat = [[42.25, 42.21], [42.63, 42.59]] attrs = {'units': 'hours since 2015-01-01'} ds_1 = xr.Dataset({'temperature': (['x', 'y', 'time'], temp)}, coords={'lon': (['x', 'y'], lon), 'lat': (['x', 'y'], lat), 'time': ('time', [100, 101, 102], attrs)}) ds_2 = xr.Dataset({'temperature': (['x', 'y', 'time'], temp+1)}, coords={'lon': (['x', 'y'], lon), 'lat': (['x', 'y'], lat), 'time': ('time', [200, 201, 202], attrs)}) ds_1.to_netcdf('ds1.nc') ds_2.to_netcdf('ds2.nc') ds = xr.open_mfdataset('ds*.nc') ds.to_netcdf('merge.nc') with xr.open_dataset('merge.nc') as f: print (f,'\n') print ('---------------------------') ds_1 = Dataset('ds1.nc') print ('keys of ds_1:') print (ds_1.variables.keys(),'\n') print ('time of ds_1:') print (ds_1.variables['time'],'\n') print ('---------------------------') merge = Dataset('merge.nc') print ('keys of merge:') print (merge.variables.keys(),'\n') print ('time of merge:') print (merge.variables['time'],'\n') ``` Problem descriptionAs Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2636/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | xarray 13221727 | issue |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issues] ( [id] INTEGER PRIMARY KEY, [node_id] TEXT, [number] INTEGER, [title] TEXT, [user] INTEGER REFERENCES [users]([id]), [state] TEXT, [locked] INTEGER, [assignee] INTEGER REFERENCES [users]([id]), [milestone] INTEGER REFERENCES [milestones]([id]), [comments] INTEGER, [created_at] TEXT, [updated_at] TEXT, [closed_at] TEXT, [author_association] TEXT, [active_lock_reason] TEXT, [draft] INTEGER, [pull_request] TEXT, [body] TEXT, [reactions] TEXT, [performed_via_github_app] TEXT, [state_reason] TEXT, [repo] INTEGER REFERENCES [repos]([id]), [type] TEXT ); CREATE INDEX [idx_issues_repo] ON [issues] ([repo]); CREATE INDEX [idx_issues_milestone] ON [issues] ([milestone]); CREATE INDEX [idx_issues_assignee] ON [issues] ([assignee]); CREATE INDEX [idx_issues_user] ON [issues] ([user]);