home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 618590688

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/3997#issuecomment-618590688 https://api.github.com/repos/pydata/xarray/issues/3997 618590688 MDEyOklzc3VlQ29tbWVudDYxODU5MDY4OA== 10676434 2020-04-23T18:54:01Z 2020-04-23T19:01:48Z NONE

data.npy.zip

Unzip data.npy.zip into data.npy

```python npy_filename = '/Users/sean/Desktop/data.npy' nc_filename = '/Users/sean/Desktop/test.nc'

data = xr.DataArray( np.load(npy_filename), dims=('animal', 'timepoint', 'pair', 'wavelength', 'y', 'x') ) data.to_netcdf(nc_filename) xr.open_dataarray(nc_filename) output:


ValueError Traceback (most recent call last) <ipython-input-147-5c2383feb8db> in <module> 4 ) 5 data.to_netcdf('/Users/sean/Desktop/test.nc') ----> 6 xr.open_dataarray('/Users/sean/Desktop/test.nc')

~/opt/anaconda3/envs/pharedox/lib/python3.7/site-packages/xarray/backends/api.py in open_dataarray(filename_or_obj, group, decode_cf, mask_and_scale, decode_times, autoclose, concat_characters, decode_coords, engine, chunks, lock, cache, drop_variables, backend_kwargs, use_cftime) 676 if len(dataset.data_vars) != 1: 677 raise ValueError( --> 678 "Given file dataset contains more than one data " 679 "variable. Please read with xarray.open_dataset and " 680 "then select the variable you want."

ValueError: Given file dataset contains more than one data variable. Please read with xarray.open_dataset and then select the variable you want. ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  605717342
Powered by Datasette · Queries took 1.022ms · About: xarray-datasette