You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/opt/anaconda3/lib/python3.8/site-packages/xarray/core/variable.py in as_variable(obj, name)
119 elif isinstance(obj, tuple):
120 if isinstance(obj[1], DataArray):
--> 121 raise TypeError(
122 "Using a DataArray object to construct a variable is"
123 " ambiguous, please extract the data using the .data property."
TypeError: Using a DataArray object to construct a variable is ambiguous, please extract the data using the .data property.
The text was updated successfully, but these errors were encountered:
meteva版本:1.5.9.4
报错信息如下:
TypeError Traceback (most recent call last)
/tmp/ipykernel_16868/2886223431.py in
----> 1 direction = meb.xarray_to_griddata(direction1, time_dim='forecast_reference_time', dtime_dim='forecast_period')
2 direction
/opt/anaconda3/lib/python3.8/site-packages/meteva/base/basicdata/grid_data.py in xarray_to_griddata(xr0, value_name, member_dim, level_dim, time_dim, dtime_dim, lat_dim, lon_dim)
268 ds.coords["dtime"] = ("dtime", dts)
269 else:
--> 270 ds.coords["dtime"] = ("dtime", dts)
271 attrs_name = list(dts.attrs)
272 for key in attrs_name:
/opt/anaconda3/lib/python3.8/site-packages/xarray/core/coordinates.py in setitem(self, key, value)
39
40 def setitem(self, key: Hashable, value: Any) -> None:
---> 41 self.update({key: value})
42
43 @Property
/opt/anaconda3/lib/python3.8/site-packages/xarray/core/coordinates.py in update(self, other)
161 def update(self, other: Mapping[Hashable, Any]) -> None:
162 other_vars = getattr(other, "variables", other)
--> 163 coords, indexes = merge_coords(
164 [self.variables, other_vars], priority_arg=1, indexes=self.xindexes
165 )
/opt/anaconda3/lib/python3.8/site-packages/xarray/core/merge.py in merge_coords(objects, compat, join, priority_arg, indexes, fill_value)
470 coerced, join=join, copy=False, indexes=indexes, fill_value=fill_value
471 )
--> 472 collected = collect_variables_and_indexes(aligned)
473 prioritized = _get_priority_vars_and_indexes(aligned, priority_arg, compat=compat)
474 variables, out_indexes = merge_collected(collected, prioritized, compat=compat)
/opt/anaconda3/lib/python3.8/site-packages/xarray/core/merge.py in collect_variables_and_indexes(list_of_mappings)
292 append_all(coords, indexes)
293
--> 294 variable = as_variable(variable, name=name)
295 if variable.dims == (name,):
296 variable = variable.to_index_variable()
/opt/anaconda3/lib/python3.8/site-packages/xarray/core/variable.py in as_variable(obj, name)
119 elif isinstance(obj, tuple):
120 if isinstance(obj[1], DataArray):
--> 121 raise TypeError(
122 "Using a DataArray object to construct a variable is"
123 " ambiguous, please extract the data using the .data property."
TypeError: Using a DataArray object to construct a variable is ambiguous, please extract the data using the .data property.
The text was updated successfully, but these errors were encountered: