We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e88926 commit c785e85Copy full SHA for c785e85
xarray_selafin/xarray_backend.py
@@ -244,16 +244,8 @@ def _raw_indexing_method(self, key):
244
values = temp[plan_indices][:, node_indices]
245
data[it] = np.reshape(values, (len(plan_indices), len(node_indices)))
246
247
- # Remove dimension if key was an integer
248
- if isinstance(node_key, int):
249
- if plan_key is None:
250
- data = data[:, 0]
251
- else:
252
- data = data[:, :, 0]
253
- if isinstance(plan_key, int):
254
- data = data[:, 0, :]
255
- if isinstance(time_key, int):
256
- data = data[0, ...]
+ # Remove dimension if the size was reduced to 1 due to indexing of integer
+ data = data.squeeze()
257
return data
258
259
0 commit comments