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__()) (np.str_('x'), np.str_('y'))
- Bus.__reversed__()[source]#
Returns a reverse iterator on the
Busindex.- Returns:
>>> 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__()) (np.str_('y'), np.str_('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
Buslabel and containedFrame.>>> 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()) ((np.str_('x'), <Frame: x> <Index> a b <<U1> <Index> p 0 1 q 2 3 r 4 5 <<U1> <int64> <int64>), (np.str_('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
Framecontained in theBus. The returnednp.ndarraywill haveFrame; this will never return an array withFrameDeferred, butmax_persistwill 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 | Accessor Mapping