__getitem__#

GeosArray.__getitem__(key)#

Select a subset of self.

Parameters:

item (int, slice, or ndarray) –

  • int: The position in ‘self’ to get.

  • slice: A slice object, where ‘start’, ‘stop’, and ‘step’ are integers or None

  • ndarray: A 1-d boolean NumPy ndarray the same length as ‘self’

  • list[int]: A list of int

Returns:

item

Return type:

scalar or ExtensionArray

Notes

For scalar item, return a scalar value suitable for the array’s type. This should be an instance of self.dtype.type.

For slice key, return an instance of ExtensionArray, even if the slice is length 0 or 1.

For a boolean mask, return an instance of ExtensionArray, filtered to the values where item is True.