Skip to content

First(count) Source

The first positions of one dimension, used by Region, such as the first 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:

Examples:

import numdaplot as ndp

scores = ndp.Array.from_list([40, 30, 20, 10])
scores.take(ndp.Region(rows=ndp.First(3)))
# Array([40, 30, 20], dtype=INT64)
scores.take(ndp.Region(rows=ndp.First(10)))
# Array([40, 30, 20, 10], dtype=INT64)