datetime.mink
datetime: B = mink (A, K)
datetime: B = mink (A, K, dim)
datetime: [B, index] = mink (A, …)
Find the earliest elements in a datetime array.
B = mink (A, K) returns the K earliest
elements of the datetime array A in ascending order. If A
is a vector, then B is a vector with K elements. If A
is a matrix, then mink operates along each column of A and
B has K rows. For multidimensional arrays, mink
operates along the first non-singleton dimension. Elements are ranked
by the instant they name, so an array with a time zone is ranked by
absolute time rather than by its wall clock.
B = mink (A, K, dim) operates along the
dimension specified by dim.
K must be a nonnegative integer scalar. If K is larger than the number of elements along the operating dimension, then all of them are returned. Infinite datetimes are ranked as ordinary values.
Missing elements (NaT) are not ranked. They are appended after
the ranked elements in their original order, and hence they only appear
in B when K exceeds the number of non-missing elements along
the operating dimension. Unlike sort, mink has no
'MissingPlacement' option, since NaT elements are always
placed last. Elements comparing as equal keep their original order.
[B, index] = mink (A, …) also returns an
index array containing the indices of the returned elements of A
along the operating dimension.
Source Code: datetime