Detail: IndexHierarchy: Operator Unary

Overview: IndexHierarchy: Operator Unary

IndexHierarchy.__abs__()
>>> ih = sf.IndexHierarchy.from_labels(((0, 1024, 32), (1, -2048, 32), (1, 1024, 32)), name=('x', 'y', 'z'))
>>> ih
<IndexHierarchy: ('x', 'y', 'z')>
0                                 1024    32
1                                 -2048   32
1                                 1024    32
<int64>                           <int64> <int64>
>>> abs(ih)
[[   0 1024   32]
 [   1 2048   32]
 [   1 1024   32]]
IndexHierarchy.__invert__()
>>> ih = sf.IndexHierarchy.from_labels(((False, True, True), (True, True, True), (False, True, False)), name=('x', 'y', 'z'))
>>> ih
<IndexHierarchy: ('x', 'y', 'z')>
False                             True   True
True                              True   True
False                             True   False
<bool>                            <bool> <bool>
>>> ~ih
[[ True False False]
 [False False False]
 [ True False  True]]
IndexHierarchy.__neg__()
>>> ih = sf.IndexHierarchy.from_labels(((0, 1024, 32), (1, -2048, 32), (1, 1024, 32)), name=('x', 'y', 'z'))
>>> ih
<IndexHierarchy: ('x', 'y', 'z')>
0                                 1024    32
1                                 -2048   32
1                                 1024    32
<int64>                           <int64> <int64>
>>> -ih
[[    0 -1024   -32]
 [   -1  2048   -32]
 [   -1 -1024   -32]]
IndexHierarchy.__pos__()
>>> ih = sf.IndexHierarchy.from_labels(((0, 1024, 32), (1, -2048, 32), (1, 1024, 32)), name=('x', 'y', 'z'))
>>> ih
<IndexHierarchy: ('x', 'y', 'z')>
0                                 1024    32
1                                 -2048   32
1                                 1024    32
<int64>                           <int64> <int64>
>>> +ih
[[    0  1024    32]
 [    1 -2048    32]
 [    1  1024    32]]

IndexHierarchy: 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 | Accessor Type Clinic