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

Function last

xarray/core/duck_array_ops.py:836–847  ·  view source on GitHub ↗

Return the last non-NA elements in this array along the given axis

(values, axis, skipna=None)

Source from the content-addressed store, hash-verified

834
835
836def last(values, axis, skipna=None):
837 """Return the last non-NA elements in this array along the given axis"""
838 if (skipna or skipna is None) and not (
839 dtypes.isdtype(values.dtype, "signed integer") or dtypes.is_string(values.dtype)
840 ):
841 # only bother for dtypes that can hold NaN
842 if is_chunked_array(values):
843 return chunked_nanlast(values, axis)
844 else:
845 return nputils.nanlast(values, axis)
846
847 return take(values, -1, axis=axis)
848
849
850def isin(element, test_elements, **kwargs):

Callers 2

test_lastMethod · 0.90
mainFunction · 0.85

Calls 2

is_chunked_arrayFunction · 0.90
chunked_nanlastFunction · 0.85

Tested by 1

test_lastMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…