Detail: Quilt: SelectorΒΆ

Overview: Quilt: Selector

Quilt[key]
Quilt.__getitem__ = <function Quilt.__getitem__>[source]
>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q = sf.Quilt(b, retain_labels=True, axis=0)
>>> q['b']
<Series: b>
<IndexHierarchy>
x                p     1
x                q     3
x                r     5
v                p     41
v                q     43
v                r     45
<<U1>            <<U1> <int64>
>>> q['a':]
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
x                p     0       1
x                q     2       3
x                r     4       5
v                p     40      41
v                q     42      43
v                r     44      45
<<U1>            <<U1> <int64> <int64>
Quilt.iloc[key]
Quilt.iloc
>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q = sf.Quilt(b, retain_labels=True, axis=0)
>>> q.iloc[3, 0]
40
>>> q.iloc[2:, 1]
<Series: b>
<IndexHierarchy>
x                r     5
v                p     41
v                q     43
v                r     45
<<U1>            <<U1> <int64>
>>> q.iloc[[0, 3, 5]]
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
x                p     0       1
v                p     40      41
v                r     44      45
<<U1>            <<U1> <int64> <int64>
Quilt.loc[key]
Quilt.loc
>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q = sf.Quilt(b, retain_labels=True, axis=0)
>>> q.loc[sf.HLoc['x', 'r']]
<Series: ('x', 'r')>
<Index>
a                    4
b                    5
<<U1>                <int64>
>>> q.loc[('x', 'r'):]
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
x                r     4       5
v                p     40      41
v                q     42      43
v                r     44      45
<<U1>            <<U1> <int64> <int64>
>>> q.loc[sf.HLoc[:, 'r']]
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
x                r     4       5
v                r     44      45
<<U1>            <<U1> <int64> <int64>

Quilt: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Selector | Iterator | Accessor Hashlib