MCPcopy
hub / github.com/pydata/xarray / first_element

Function first_element

xarray/tests/test_computation.py:438–442  ·  view source on GitHub ↗
(obj, dim)

Source from the content-addressed store, hash-verified

436
437def test_apply_input_core_dimension() -> None:
438 def first_element(obj, dim):
439 def func(x):
440 return x[..., 0]
441
442 return apply_ufunc(func, obj, input_core_dims=[[dim]])
443
444 array = np.array([[1, 2], [3, 4]])
445 variable = xr.Variable(["x", "y"], array)

Callers 1

Calls 1

apply_ufuncFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…