Detail: Quilt: Dictionary-Like

Overview: Quilt: Dictionary-Like

Quilt.__contains__(value)[source]

Inclusion of value in column labels.

>>> 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
<Quilt: j>
<Index: Aligned> a b <<U1>
<Index: Frames>
x                . .
v                . .
<<U1>
>>> q.__contains__('a')
True
Quilt.__iter__()[source]

Iterator of column labels, same as Frame.keys().

>>> 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
<Quilt: j>
<Index: Aligned> a b <<U1>
<Index: Frames>
x                . .
v                . .
<<U1>
>>> tuple(q.__iter__())
('a', 'b')
Quilt.get(key, default=None)[source]

Return the value found at the columns key, else the default if the key is not found. This method is implemented to complete the dictionary-like interface.

>>> 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
<Quilt: j>
<Index: Aligned> a b <<U1>
<Index: Frames>
x                . .
v                . .
<<U1>
>>> q.get('a')
<Series: a>
<IndexHierarchy>
x                p     0
x                q     2
x                r     4
v                p     40
v                q     42
v                r     44
<<U1>            <<U1> <int64>
>>> q.get('z', -1)
-1
Quilt.items()[source]

Iterator of pairs of column label and corresponding column Series.

>>> 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
<Quilt: j>
<Index: Aligned> a b <<U1>
<Index: Frames>
x                . .
v                . .
<<U1>
>>> tuple(q.items())
NotImplementedAxis('Iteration along this axis is too inefficient; create a consolidated Frame with Quilt.to_frame()')
Quilt.keys()[source]

Iterator of column labels.

>>> 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
<Quilt: j>
<Index: Aligned> a b <<U1>
<Index: Frames>
x                . .
v                . .
<<U1>
>>> tuple(q.keys())
('a', 'b')
Quilt.values

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

>>> 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
<Quilt: j>
<Index: Aligned> a b <<U1>
<Index: Frames>
x                . .
v                . .
<<U1>
>>> q.values
[[ 0  1]
 [ 2  3]
 [ 4  5]
 [40 41]
 [42 43]
 [44 45]]

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