Detail: Bus: Dictionary-Like

Overview: Bus: Dictionary-Like

Bus.__contains__(value)[source]

Inclusion of value in index labels.

Returns:

bool

>>> 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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i')
>>> b
<Bus: i>
<Index>
x        Frame
y        Frame
<<U1>    <object>
>>> b.__contains__('a')
False
Bus.__iter__()[source]

Iterator of index labels, same as static_frame.Series.keys.

Returns:

Iterator[Hashasble]

>>> 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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i')
>>> b
<Bus: i>
<Index>
x        Frame
y        Frame
<<U1>    <object>
>>> tuple(b.__iter__())
('x', 'y')
Bus.__reversed__()[source]

Returns a reverse iterator on the Bus index.

Returns:

Index

>>> 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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i')
>>> b
<Bus: i>
<Index>
x        Frame
y        Frame
<<U1>    <object>
>>> tuple(b.__reversed__())
('y', 'x')
Bus.get(key, default=None)[source]

Return the value found at the index key, else the default if the key is not found.

Returns:

Any

>>> 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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i')
>>> b
<Bus: i>
<Index>
x        Frame
y        Frame
<<U1>    <object>
>>> b.get('a')
>>> b.get('z', -1)
-1
Bus.items()[source]

Iterator of pairs of Bus label and contained Frame.

>>> 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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i')
>>> b
<Bus: i>
<Index>
x        Frame
y        Frame
<<U1>    <object>
>>> tuple(b.items())
(('x', <Frame: x>
<Index>    a       b       <<U1>
<Index>
p          0       1
q          2       3
r          4       5
<<U1>      <int64> <int64>), ('y', <Frame: y>
<Index>    c      d      <<U1>
<Index>
p          False  True
q          False  True
r          False  True
<<U1>      <bool> <bool>))
Bus.keys()[source]

Iterator of index labels.

Returns:

Iterator[Hashable]

>>> 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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i')
>>> b
<Bus: i>
<Index>
x        Frame
y        Frame
<<U1>    <object>
>>> b.keys()
<Index>
x
y
<<U1>
Bus.values

A 1D object array of all Frame contained in the Bus. The returned np.ndarray will have Frame; this will never return an array with FrameDeferred, but max_persist will be observed in reading from the Store.

>>> 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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i')
>>> b
<Bus: i>
<Index>
x        Frame
y        Frame
<<U1>    <object>
>>> b.values
[<Frame: x>
 <Index>    a       b       <<U1>
 <Index>
 p          0       1
 q          2       3
 r          4       5
 <<U1>      <int64> <int64>       <Frame: y>
                                  <Index>    c      d      <<U1>
                                  <Index>
                                  p          False  True
                                  q          False  True
                                  r          False  True
                                  <<U1>      <bool> <bool>      ]

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