larray.LSet

class larray.LSet(key, name=None, axis=None)[source]

Label set.

Represents a set of (unique) labels of an axis.

Parameters
keykey

Anything usable for indexing. A key should be either sequence of labels, a slice with label bounds or a string.

namestr, optional

Name of the set.

axisint, str, Axis, optional

Axis for set.

Examples

>>> from larray import Axis
>>> letters = Axis('letters=a..z')
>>> abc = letters[':c'].set() >> 'abc'
>>> abc
letters['a', 'b', 'c'].set() >> 'abc'
>>> abc & letters['b:d']
letters['b', 'c'].set()
__init__(self, key, name=None, axis=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self, key[, name, axis])

Initialize self.

by(self, length[, step, template])

Split group into several groups of specified length.

containing(self, substring)

Returns a group with all the labels containing the specified substring.

difference(self, other)

endingwith(self, suffix)

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

equals(self, other)

Checks if this group is equal to another group.

eval(self)

Translate key to labels, if it is not already, expanding slices in the process.

intersection(self, other)

matching(self[, deprecated, pattern, regex])

Returns a group with all the labels matching the specified pattern or regular expression.

named(self, name)

Returns group with a different name.

retarget_to(self, target_axis)

Retarget group to another axis.

set(self)

Creates LSet from this group

startingwith(self, prefix)

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

to_hdf(self, filepath[, key, axis_key])

Writes group to a HDF file.

to_label(self)

Translate key to labels, if it is not already

translate(self[, bound, stop])

compute position(s) of group

union(self, other)

with_axis(self, axis)

Returns group with a different axis.

Attributes

axis

format_string

key

name