Detail: IndexHierarchyGO: Dictionary-Like

Overview: IndexHierarchyGO: Dictionary-Like

IndexHierarchyGO.__contains__(value)

Determine if a label value is contained in this Index.

>>> ih = sf.IndexHierarchyGO.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.__contains__('a')
RuntimeError('Invalid key length for a; must be length 3.')
IndexHierarchyGO.__iter__()

Iterate over labels.

>>> ih = sf.IndexHierarchyGO.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> tuple(ih.__iter__())
(('a', 1024, numpy.datetime64('1517-04-01')), ('a', 2048, numpy.datetime64('1789-12-31')), ('b', 0, numpy.datetime64('1620-11-21')))
IndexHierarchyGO.__reversed__()

Returns a reverse iterator on the index labels.

>>> ih = sf.IndexHierarchyGO.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> tuple(ih.__reversed__())
(('b', 0, datetime.date(1620, 11, 21)), ('a', 2048, datetime.date(1789, 12, 31)), ('a', 1024, datetime.date(1517, 4, 1)))
IndexHierarchyGO.values

A 2D NumPy array of all values in the IndexHierarchy. As this is a single array, heterogenous columnar types might be coerced to a compatible type.

>>> ih = sf.IndexHierarchyGO.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.values_at_depth(0)
['a' 'a' 'b']
>>> ih.values_at_depth(2)
['1517-04-01' '1789-12-31' '1620-11-21']

IndexHierarchyGO: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Selector | Iterator | Operator Binary | Operator Unary | Accessor Values | Accessor Datetime | Accessor String | Accessor Transpose | Accessor Regular Expression | Accessor Hashlib