Detail: Batch: Dictionary-Like

Overview: Batch: Dictionary-Like

Batch.__iter__()[source]

Iterator of Frame labels, same as Batch.keys.

>>> bt = sf.Batch((('i', sf.Frame.from_fields(((10, 2, 8, 3), (False, True, True, False), ('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30')), index=sf.IndexHierarchy.from_product((0, 1), ('p', 'q')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x')), ('j', sf.Frame.from_fields(((23, 83, 19, 87), (True, True, False, False), ('2022-01-01', '2023-04-01', '2022-12-31', '2024-06-30')), index=sf.IndexHierarchy.from_product((0, 1), ('p', 'q')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x'))))
>>> tuple(bt.__iter__())
('i', 'j')
Batch.items()[source]

Iterator of labels, Frame.

>>> bt = sf.Batch((('i', sf.Frame.from_fields(((10, 2, 8, 3), (False, True, True, False), ('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30')), index=sf.IndexHierarchy.from_product((0, 1), ('p', 'q')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x')), ('j', sf.Frame.from_fields(((23, 83, 19, 87), (True, True, False, False), ('2022-01-01', '2023-04-01', '2022-12-31', '2024-06-30')), index=sf.IndexHierarchy.from_product((0, 1), ('p', 'q')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x'))))
>>> tuple(bt.items())
(('i', <Frame: x>
<Index>                a       b      c               <<U1>
<IndexHierarchy>
0                p     10      False  1517-01-01
0                q     2       True   1517-04-01
1                p     8       True   1517-12-31
1                q     3       False  1517-06-30
<int64>          <<U1> <int64> <bool> <datetime64[D]>), ('j', <Frame: x>
<Index>                a       b      c               <<U1>
<IndexHierarchy>
0                p     23      True   2022-01-01
0                q     83      True   2023-04-01
1                p     19      False  2022-12-31
1                q     87      False  2024-06-30
<int64>          <<U1> <int64> <bool> <datetime64[D]>))
Batch.keys()[source]

Iterator of Frame labels.

>>> bt = sf.Batch((('i', sf.Frame.from_fields(((10, 2, 8, 3), (False, True, True, False), ('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30')), index=sf.IndexHierarchy.from_product((0, 1), ('p', 'q')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x')), ('j', sf.Frame.from_fields(((23, 83, 19, 87), (True, True, False, False), ('2022-01-01', '2023-04-01', '2022-12-31', '2024-06-30')), index=sf.IndexHierarchy.from_product((0, 1), ('p', 'q')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x'))))
>>> tuple(bt.keys())
('i', 'j')
Batch.values

Return an iterator of values (Frame or Series) stored in this Batch.

>>> bt = sf.Batch((('i', sf.Frame.from_fields(((10, 2, 8, 3), (False, True, True, False), ('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30')), index=sf.IndexHierarchy.from_product((0, 1), ('p', 'q')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x')), ('j', sf.Frame.from_fields(((23, 83, 19, 87), (True, True, False, False), ('2022-01-01', '2023-04-01', '2022-12-31', '2024-06-30')), index=sf.IndexHierarchy.from_product((0, 1), ('p', 'q')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x'))))
>>> tuple(bt.values)
(<Frame: x>
<Index>                a       b      c               <<U1>
<IndexHierarchy>
0                p     10      False  1517-01-01
0                q     2       True   1517-04-01
1                p     8       True   1517-12-31
1                q     3       False  1517-06-30
<int64>          <<U1> <int64> <bool> <datetime64[D]>, <Frame: x>
<Index>                a       b      c               <<U1>
<IndexHierarchy>
0                p     23      True   2022-01-01
0                q     83      True   2023-04-01
1                p     19      False  2022-12-31
1                q     87      False  2024-06-30
<int64>          <<U1> <int64> <bool> <datetime64[D]>)

Batch: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Selector | Operator Binary | Operator Unary | Accessor Values | Accessor Datetime | Accessor String | Accessor Transpose | Accessor Fill Value | Accessor Regular Expression | Accessor Hashlib | Accessor Type Clinic