Last(count)
Source¶
The last positions of one dimension, used by Region, such as the last 10 rows of a sorted Table.
A dimension shorter than the count gives every position, without error.
Added in version 0.2.0
Parameters:
-
count(int)The number of positions, at least 1.
Raises:
-
InvalidTypeErrorWhen a setting is not of the type its annotation names.
-
InvalidCountErrorWhen
countis 0 or negative.
Examples:
import numdaplot as ndp
scores = ndp.Array.from_list([40, 30, 20, 10])
scores.take(ndp.Region(rows=ndp.Last(3)))
# Array([30, 20, 10], dtype=INT64)
scores.take(ndp.Region(rows=ndp.Last(10)))
# Array([40, 30, 20, 10], dtype=INT64)