larray.LGroup.startingwith

LGroup.startingwith(self, prefix)

Returns a group with the labels starting with the specified string.

Parameters:
prefix : str or Group

The prefix to search for.

Returns:
LGroup

Group containing all the labels starting with the given string.

Examples

>>> from larray import Axis
>>> people = Axis(['Bruce Wayne', 'Arthur Dent', 'Harvey Dent'], 'people')
>>> group = people.endingwith('Dent')
>>> group
people['Arthur Dent', 'Harvey Dent']
>>> group.startingwith('Art')
people['Arthur Dent']