Return the first non-NA elements in this array along the given axis
(values, axis, skipna=None)
| 820 | |
| 821 | |
| 822 | def first(values, axis, skipna=None): |
| 823 | """Return the first non-NA elements in this array along the given axis""" |
| 824 | if (skipna or skipna is None) and not ( |
| 825 | dtypes.isdtype(values.dtype, "signed integer") or dtypes.is_string(values.dtype) |
| 826 | ): |
| 827 | # only bother for dtypes that can hold NaN |
| 828 | if is_chunked_array(values): |
| 829 | return chunked_nanfirst(values, axis) |
| 830 | else: |
| 831 | return nputils.nanfirst(values, axis) |
| 832 | |
| 833 | return take(values, 0, axis=axis) |
| 834 | |
| 835 | |
| 836 | def last(values, axis, skipna=None): |
searching dependent graphs…