Detail: Bus: Iterator#
- Bus.iter_element
- iter_element
Iterator of elements.
>>> 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element()) (<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>, <Frame: v> <Index> a b <<U1> <Index> p 40 41 q 42 43 r 44 45 <<U1> <int64> <int64>, <Frame: w> <Index> c d <<U1> <Index> p False True q True False r True True <<U1> <bool> <bool>)
- Bus.iter_element().apply(func, /, *, dtype, name, index_constructor, columns_constructor)
- iter_element
Iterator of elements.
- IterNodeDelegateReducible.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)
Apply a function to each value. Returns a new container.
- Parameters:
func – A function that takes a value.
dtype – A value suitable for specyfying a NumPy dtype, such as a Python type (float), NumPy array protocol strings (‘f8’), or a dtype instance.
>>> 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> b.iter_element().apply(lambda f: f.shape) <Series> <Index> x (3, 2) y (3, 2) v (3, 2) w (3, 2) <<U1> <object>
- Bus.iter_element().apply_iter(func, /)
- iter_element
Iterator of elements.
- IterNodeDelegateReducible.apply_iter(func, /)
Apply a function to each value. A generator of resulting values.
- Parameters:
func – A function that takes a value.
- Yields:
Values after function application.
>>> 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().apply_iter(lambda f: f.nbytes)) (48, 6, 48, 6)
- Bus.iter_element().apply_iter_items(func, /)
- iter_element
Iterator of elements.
- IterNodeDelegateReducible.apply_iter_items(func, /)
Apply a function to each value. A generator of resulting key, value pairs.
- Parameters:
func – A function that takes a value.
- Yields:
Pairs of label, value after function application.
>>> 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().apply_iter_items(lambda f: f.nbytes)) ((np.str_('x'), 48), (np.str_('y'), 6), (np.str_('v'), 48), (np.str_('w'), 6))
- Bus.iter_element().apply_pool(func, /, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
- iter_element
Iterator of elements.
- IterNodeDelegateReducible.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)
Apply a function to each value. Employ parallel processing with either the ProcessPoolExecutor or ThreadPoolExecutor.
- Parameters:
func – A function that takes a value.
* –
dtype – A value suitable for specyfying a NumPy dtype, such as a Python type (float), NumPy array protocol strings (‘f8’), or a dtype instance.
name – A hashable object to label the container.
max_workers – Number of parallel executors, as passed to the Thread- or ProcessPoolExecutor;
Nonedefaults to the max number of machine processes.chunksize – Units of work per executor, as passed to the Thread- or ProcessPoolExecutor.
use_threads – Use the ThreadPoolExecutor instead of the ProcessPoolExecutor.
>>> 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> def func(f): return f.sum().sum() >>> b.iter_element().apply_pool(func, use_threads=True) <Series> <Index> x 15 y 3 v 255 w 4 <<U1> <int64>
- Bus.iter_element().reduce.from_func(func, *, fill_value).keys()
- iter_element
Iterator of elements.
- ReduceDispatch.from_func(func, *, fill_value=nan)[source]
For each Frame, and given a function func that returns either a Series or a Frame, call that function on each 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_func(lambda f: f.iloc[1:]).keys()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element().reduce.from_func(func, *, fill_value).__iter__()
- iter_element
Iterator of elements.
- ReduceDispatch.from_func(func, *, fill_value=nan)[source]
For each Frame, and given a function func that returns either a Series or a Frame, call that function on each 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_func(lambda f: f.iloc[1:]).__iter__()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element().reduce.from_func(func, *, fill_value).items()
- iter_element
Iterator of elements.
- ReduceDispatch.from_func(func, *, fill_value=nan)[source]
For each Frame, and given a function func that returns either a Series or a Frame, call that function on each 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_func(lambda f: f.iloc[1:]).items()) ((np.str_('x'), <Frame: x> <Index> a b <<U1> <Index> q 2 3 r 4 5 <<U1> <int64> <int64>), (np.str_('y'), <Frame: y> <Index> c d <<U1> <Index> q False True r False True <<U1> <bool> <bool>), (np.str_('v'), <Frame: v> <Index> a b <<U1> <Index> q 42 43 r 44 45 <<U1> <int64> <int64>), (np.str_('w'), <Frame: w> <Index> c d <<U1> <Index> q True False r True True <<U1> <bool> <bool>))
- Bus.iter_element().reduce.from_func(func, *, fill_value).values()
- iter_element
Iterator of elements.
- ReduceDispatch.from_func(func, *, fill_value=nan)[source]
For each Frame, and given a function func that returns either a Series or a Frame, call that function on each 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_func(lambda f: f.iloc[1:]).values()) (<Frame: x> <Index> a b <<U1> <Index> q 2 3 r 4 5 <<U1> <int64> <int64>, <Frame: y> <Index> c d <<U1> <Index> q False True r False True <<U1> <bool> <bool>, <Frame: v> <Index> a b <<U1> <Index> q 42 43 r 44 45 <<U1> <int64> <int64>, <Frame: w> <Index> c d <<U1> <Index> q True False r True True <<U1> <bool> <bool>)
- Bus.iter_element().reduce.from_func(func, *, fill_value).to_frame(*, index, columns, index_constructor, columns_constructor, name, consolidate_blocks)
- iter_element
Iterator of elements.
- ReduceDispatch.from_func(func, *, fill_value=nan)[source]
For each Frame, and given a function func that returns either a Series or a Frame, call that function on each 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> b.iter_element().reduce.from_func(lambda f: f.iloc[1:]).to_frame(index=sf.IndexAutoFactory) <Frame> <Index> a b c d <<U1> <Index> 0 2.0 3.0 nan nan 1 4.0 5.0 nan nan 2 nan nan False True 3 nan nan False True 4 42.0 43.0 nan nan 5 44.0 45.0 nan nan 6 nan nan True False 7 nan nan True True <int64> <float64> <float64> <object> <object>
- Bus.iter_element().reduce.from_map_func(func, *, fill_value).keys()
- iter_element
Iterator of elements.
- ReduceDispatch.from_map_func(func, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_map_func(np.min).keys()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element().reduce.from_map_func(func, *, fill_value).__iter__()
- iter_element
Iterator of elements.
- ReduceDispatch.from_map_func(func, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_map_func(np.min).__iter__()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element().reduce.from_map_func(func, *, fill_value).items()
- iter_element
Iterator of elements.
- ReduceDispatch.from_map_func(func, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_map_func(np.min).items()) ((np.str_('x'), <Series: x> <Index> a 0 b 1 <<U1> <int64>), (np.str_('y'), <Series: y> <Index> c False d True <<U1> <bool>), (np.str_('v'), <Series: v> <Index> a 40 b 41 <<U1> <int64>), (np.str_('w'), <Series: w> <Index> c False d False <<U1> <bool>))
- Bus.iter_element().reduce.from_map_func(func, *, fill_value).values()
- iter_element
Iterator of elements.
- ReduceDispatch.from_map_func(func, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_map_func(np.min).values()) (<Series: x> <Index> a 0 b 1 <<U1> <int64>, <Series: y> <Index> c False d True <<U1> <bool>, <Series: v> <Index> a 40 b 41 <<U1> <int64>, <Series: w> <Index> c False d False <<U1> <bool>)
- Bus.iter_element().reduce.from_map_func(func, *, fill_value).to_frame(*, index, columns, index_constructor, columns_constructor, name, consolidate_blocks)
- iter_element
Iterator of elements.
- ReduceDispatch.from_map_func(func, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> b.iter_element().reduce.from_map_func(np.min).to_frame() <Frame> <Index> a b c d <<U1> <Index> x 0.0 1.0 nan nan y nan nan False True v 40.0 41.0 nan nan w nan nan False False <<U1> <float64> <float64> <object> <object>
- Bus.iter_element().reduce.from_label_map(func_map, *, fill_value).keys()
- iter_element
Iterator of elements.
- ReduceDispatch.from_label_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_label_map({'b': np.min, 'a': np.max}).keys()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element().reduce.from_label_map(func_map, *, fill_value).__iter__()
- iter_element
Iterator of elements.
- ReduceDispatch.from_label_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_label_map({'b': np.min, 'a': np.max}).__iter__()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element().reduce.from_label_map(func_map, *, fill_value).items()
- iter_element
Iterator of elements.
- ReduceDispatch.from_label_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_label_map({'b': np.min, 'a': np.max}).items()) ((np.str_('x'), <Series: x> <Index> b 1 a 4 <<U1> <int64>), (np.str_('y'), <Series: y> <Index> b nan a nan <<U1> <float64>), (np.str_('v'), <Series: v> <Index> b 41 a 44 <<U1> <int64>), (np.str_('w'), <Series: w> <Index> b nan a nan <<U1> <float64>))
- Bus.iter_element().reduce.from_label_map(func_map, *, fill_value).values()
- iter_element
Iterator of elements.
- ReduceDispatch.from_label_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_label_map({'b': np.min, 'a': np.max}).values()) (<Series: x> <Index> b 1 a 4 <<U1> <int64>, <Series: y> <Index> b nan a nan <<U1> <float64>, <Series: v> <Index> b 41 a 44 <<U1> <int64>, <Series: w> <Index> b nan a nan <<U1> <float64>)
- Bus.iter_element().reduce.from_label_map(func_map, *, fill_value).to_frame(*, index, columns, index_constructor, columns_constructor, name, consolidate_blocks)
- iter_element
Iterator of elements.
- ReduceDispatch.from_label_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> b.iter_element().reduce.from_label_map({'b': np.min, 'a': np.max}).to_frame() <Frame> <Index> b a <<U1> <Index> x 1.0 4.0 y nan nan v 41.0 44.0 w nan nan <<U1> <float64> <float64>
- Bus.iter_element().reduce.from_label_pair_map(func_map, *, fill_value).keys()
- iter_element
Iterator of elements.
- ReduceDispatch.from_label_pair_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_label_pair_map({('b', 'b-min'): np.min, ('b', 'b-max'): np.max}).keys()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element().reduce.from_label_pair_map(func_map, *, fill_value).__iter__()
- iter_element
Iterator of elements.
- ReduceDispatch.from_label_pair_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_label_pair_map({('b', 'b-min'): np.min, ('b', 'b-max'): np.max}).__iter__()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element().reduce.from_label_pair_map(func_map, *, fill_value).items()
- iter_element
Iterator of elements.
- ReduceDispatch.from_label_pair_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_label_pair_map({('b', 'b-min'): np.min, ('b', 'b-max'): np.max}).items()) ((np.str_('x'), <Series: x> <Index> b-min 1 b-max 5 <<U5> <int64>), (np.str_('y'), <Series: y> <Index> b-min nan b-max nan <<U5> <float64>), (np.str_('v'), <Series: v> <Index> b-min 41 b-max 45 <<U5> <int64>), (np.str_('w'), <Series: w> <Index> b-min nan b-max nan <<U5> <float64>))
- Bus.iter_element().reduce.from_label_pair_map(func_map, *, fill_value).values()
- iter_element
Iterator of elements.
- ReduceDispatch.from_label_pair_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element().reduce.from_label_pair_map({('b', 'b-min'): np.min, ('b', 'b-max'): np.max}).values()) (<Series: x> <Index> b-min 1 b-max 5 <<U5> <int64>, <Series: y> <Index> b-min nan b-max nan <<U5> <float64>, <Series: v> <Index> b-min 41 b-max 45 <<U5> <int64>, <Series: w> <Index> b-min nan b-max nan <<U5> <float64>)
- Bus.iter_element().reduce.from_label_pair_map(func_map, *, fill_value).to_frame(*, index, columns, index_constructor, columns_constructor, name, consolidate_blocks)
- iter_element
Iterator of elements.
- ReduceDispatch.from_label_pair_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> b.iter_element().reduce.from_label_pair_map({('b', 'b-min'): np.min, ('b', 'b-max'): np.max}).to_frame() <Frame> <Index> b-min b-max <<U5> <Index> x 1.0 5.0 y nan nan v 41.0 45.0 w nan nan <<U1> <float64> <float64>
- Bus.iter_element_items
- iter_element_items
Iterator of label, element pairs.
>>> 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_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>), (np.str_('v'), <Frame: v> <Index> a b <<U1> <Index> p 40 41 q 42 43 r 44 45 <<U1> <int64> <int64>), (np.str_('w'), <Frame: w> <Index> c d <<U1> <Index> p False True q True False r True True <<U1> <bool> <bool>))
- Bus.iter_element_items().apply(func, /, *, dtype, name, index_constructor, columns_constructor)
- iter_element_items
Iterator of label, element pairs.
- IterNodeDelegateReducible.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)
Apply a function to each value. Returns a new container.
- Parameters:
func – A function that takes a value.
dtype – A value suitable for specyfying a NumPy dtype, such as a Python type (float), NumPy array protocol strings (‘f8’), or a dtype instance.
>>> 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> b.iter_element_items().apply(lambda l, f: f.size if l != 'v' else 0) <Series> <Index> x 6 y 6 v 0 w 6 <<U1> <int64>
- Bus.iter_element_items().apply_iter(func, /)
- iter_element_items
Iterator of label, element pairs.
- IterNodeDelegateReducible.apply_iter(func, /)
Apply a function to each value. A generator of resulting values.
- Parameters:
func – A function that takes a value.
- Yields:
Values after function application.
>>> 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().apply_iter(lambda l, f: f.shape if l != 'x' else 0)) (0, (3, 2), (3, 2), (3, 2))
- Bus.iter_element_items().apply_iter_items(func, /)
- iter_element_items
Iterator of label, element pairs.
- IterNodeDelegateReducible.apply_iter_items(func, /)
Apply a function to each value. A generator of resulting key, value pairs.
- Parameters:
func – A function that takes a value.
- Yields:
Pairs of label, value after function application.
>>> 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().apply_iter_items(lambda l, f: f.shape if l != 'x' else 0)) ((np.str_('x'), 0), (np.str_('y'), (3, 2)), (np.str_('v'), (3, 2)), (np.str_('w'), (3, 2)))
- Bus.iter_element_items().apply_pool(func, /, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
- iter_element_items
Iterator of label, element pairs.
- IterNodeDelegateReducible.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)
Apply a function to each value. Employ parallel processing with either the ProcessPoolExecutor or ThreadPoolExecutor.
- Parameters:
func – A function that takes a value.
* –
dtype – A value suitable for specyfying a NumPy dtype, such as a Python type (float), NumPy array protocol strings (‘f8’), or a dtype instance.
name – A hashable object to label the container.
max_workers – Number of parallel executors, as passed to the Thread- or ProcessPoolExecutor;
Nonedefaults to the max number of machine processes.chunksize – Units of work per executor, as passed to the Thread- or ProcessPoolExecutor.
use_threads – Use the ThreadPoolExecutor instead of the ProcessPoolExecutor.
>>> 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> def func(pair): return pair[1].sum().sum() if pair[0] != 'v' else -1 >>> b.iter_element_items().apply_pool(func, use_threads=True) <Series> <Index> x 15 y 3 v -1 w 4 <<U1> <int64>
- Bus.iter_element_items().reduce.from_func(func, *, fill_value).keys()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_func(func, *, fill_value=nan)[source]
For each Frame, and given a function func that returns either a Series or a Frame, call that function on each 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_func(lambda l, f: f.iloc[1:]).keys()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element_items().reduce.from_func(func, *, fill_value).__iter__()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_func(func, *, fill_value=nan)[source]
For each Frame, and given a function func that returns either a Series or a Frame, call that function on each 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_func(lambda l, f: f.iloc[1:]).__iter__()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element_items().reduce.from_func(func, *, fill_value).items()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_func(func, *, fill_value=nan)[source]
For each Frame, and given a function func that returns either a Series or a Frame, call that function on each 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_func(lambda l, f: f.iloc[1:]).items()) ((np.str_('x'), <Frame: x> <Index> a b <<U1> <Index> q 2 3 r 4 5 <<U1> <int64> <int64>), (np.str_('y'), <Frame: y> <Index> c d <<U1> <Index> q False True r False True <<U1> <bool> <bool>), (np.str_('v'), <Frame: v> <Index> a b <<U1> <Index> q 42 43 r 44 45 <<U1> <int64> <int64>), (np.str_('w'), <Frame: w> <Index> c d <<U1> <Index> q True False r True True <<U1> <bool> <bool>))
- Bus.iter_element_items().reduce.from_func(func, *, fill_value).values()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_func(func, *, fill_value=nan)[source]
For each Frame, and given a function func that returns either a Series or a Frame, call that function on each 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_func(lambda l, f: f.iloc[1:]).values()) (<Frame: x> <Index> a b <<U1> <Index> q 2 3 r 4 5 <<U1> <int64> <int64>, <Frame: y> <Index> c d <<U1> <Index> q False True r False True <<U1> <bool> <bool>, <Frame: v> <Index> a b <<U1> <Index> q 42 43 r 44 45 <<U1> <int64> <int64>, <Frame: w> <Index> c d <<U1> <Index> q True False r True True <<U1> <bool> <bool>)
- Bus.iter_element_items().reduce.from_func(func, *, fill_value).to_frame(*, index, columns, index_constructor, columns_constructor, name, consolidate_blocks)
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_func(func, *, fill_value=nan)[source]
For each Frame, and given a function func that returns either a Series or a Frame, call that function on each 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'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> b.iter_element_items().reduce.from_func(lambda l, f: f.iloc[1:]).to_frame(index=sf.IndexAutoFactory) <Frame> <Index> a b c d <<U1> <Index> 0 2.0 3.0 nan nan 1 4.0 5.0 nan nan 2 nan nan False True 3 nan nan False True 4 42.0 43.0 nan nan 5 44.0 45.0 nan nan 6 nan nan True False 7 nan nan True True <int64> <float64> <float64> <object> <object>
- Bus.iter_element_items().reduce.from_map_func(func, *, fill_value).keys()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_map_func(func, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_map_func(lambda s: np.min(s)).keys()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element_items().reduce.from_map_func(func, *, fill_value).__iter__()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_map_func(func, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_map_func(lambda s: np.min(s)).__iter__()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element_items().reduce.from_map_func(func, *, fill_value).items()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_map_func(func, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_map_func(lambda s: np.min(s)).items()) ((np.str_('x'), <Series: x> <Index> a 0 b 1 <<U1> <int64>), (np.str_('y'), <Series: y> <Index> c False d True <<U1> <bool>), (np.str_('v'), <Series: v> <Index> a 40 b 41 <<U1> <int64>), (np.str_('w'), <Series: w> <Index> c False d False <<U1> <bool>))
- Bus.iter_element_items().reduce.from_map_func(func, *, fill_value).values()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_map_func(func, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_map_func(lambda s: np.min(s)).values()) (<Series: x> <Index> a 0 b 1 <<U1> <int64>, <Series: y> <Index> c False d True <<U1> <bool>, <Series: v> <Index> a 40 b 41 <<U1> <int64>, <Series: w> <Index> c False d False <<U1> <bool>)
- Bus.iter_element_items().reduce.from_map_func(func, *, fill_value).to_frame(*, index, columns, index_constructor, columns_constructor, name, consolidate_blocks)
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_map_func(func, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> b.iter_element_items().reduce.from_map_func(lambda s: np.min(s)).to_frame() <Frame> <Index> a b c d <<U1> <Index> x 0.0 1.0 nan nan y nan nan False True v 40.0 41.0 nan nan w nan nan False False <<U1> <float64> <float64> <object> <object>
- Bus.iter_element_items().reduce.from_label_map(func_map, *, fill_value).keys()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_label_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_label_map({'b': lambda l, s: np.min(s), 'a': lambda l, s: np.max(s)}).keys()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element_items().reduce.from_label_map(func_map, *, fill_value).__iter__()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_label_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_label_map({'b': lambda l, s: np.min(s), 'a': lambda l, s: np.max(s)}).__iter__()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element_items().reduce.from_label_map(func_map, *, fill_value).items()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_label_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_label_map({'b': lambda l, s: np.min(s), 'a': lambda l, s: np.max(s)}).items()) ((np.str_('x'), <Series: x> <Index> b 1 a 4 <<U1> <int64>), (np.str_('y'), <Series: y> <Index> b nan a nan <<U1> <float64>), (np.str_('v'), <Series: v> <Index> b 41 a 44 <<U1> <int64>), (np.str_('w'), <Series: w> <Index> b nan a nan <<U1> <float64>))
- Bus.iter_element_items().reduce.from_label_map(func_map, *, fill_value).values()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_label_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_label_map({'b': lambda l, s: np.min(s), 'a': lambda l, s: np.max(s)}).values()) (<Series: x> <Index> b 1 a 4 <<U1> <int64>, <Series: y> <Index> b nan a nan <<U1> <float64>, <Series: v> <Index> b 41 a 44 <<U1> <int64>, <Series: w> <Index> b nan a nan <<U1> <float64>)
- Bus.iter_element_items().reduce.from_label_map(func_map, *, fill_value).to_frame(*, index, columns, index_constructor, columns_constructor, name, consolidate_blocks)
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_label_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> b.iter_element_items().reduce.from_label_map({'b': lambda l, s: np.min(s), 'a': lambda l, s: np.max(s)}).to_frame() <Frame> <Index> b a <<U1> <Index> x 1.0 4.0 y nan nan v 41.0 44.0 w nan nan <<U1> <float64> <float64>
- Bus.iter_element_items().reduce.from_label_pair_map(func_map, *, fill_value).keys()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_label_pair_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_label_pair_map({('b', 'b-min'): lambda l, s: np.min(s), ('b', 'b-max'): lambda l, s: np.max(s)}).keys()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element_items().reduce.from_label_pair_map(func_map, *, fill_value).__iter__()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_label_pair_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_label_pair_map({('b', 'b-min'): lambda l, s: np.min(s), ('b', 'b-max'): lambda l, s: np.max(s)}).__iter__()) (np.str_('x'), np.str_('y'), np.str_('v'), np.str_('w'))
- Bus.iter_element_items().reduce.from_label_pair_map(func_map, *, fill_value).items()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_label_pair_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_label_pair_map({('b', 'b-min'): lambda l, s: np.min(s), ('b', 'b-max'): lambda l, s: np.max(s)}).items()) ((np.str_('x'), <Series: x> <Index> b-min 1 b-max 5 <<U5> <int64>), (np.str_('y'), <Series: y> <Index> b-min nan b-max nan <<U5> <float64>), (np.str_('v'), <Series: v> <Index> b-min 41 b-max 45 <<U5> <int64>), (np.str_('w'), <Series: w> <Index> b-min nan b-max nan <<U5> <float64>))
- Bus.iter_element_items().reduce.from_label_pair_map(func_map, *, fill_value).values()
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_label_pair_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> tuple(b.iter_element_items().reduce.from_label_pair_map({('b', 'b-min'): lambda l, s: np.min(s), ('b', 'b-max'): lambda l, s: np.max(s)}).values()) (<Series: x> <Index> b-min 1 b-max 5 <<U5> <int64>, <Series: y> <Index> b-min nan b-max nan <<U5> <float64>, <Series: v> <Index> b-min 41 b-max 45 <<U5> <int64>, <Series: w> <Index> b-min nan b-max nan <<U5> <float64>)
- Bus.iter_element_items().reduce.from_label_pair_map(func_map, *, fill_value).to_frame(*, index, columns, index_constructor, columns_constructor, name, consolidate_blocks)
- iter_element_items
Iterator of label, element pairs.
- ReduceDispatch.from_label_pair_map(func_map, *, fill_value=nan)[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(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='k') >>> b <Bus: k> <Index> x Frame y Frame v Frame w Frame <<U1> <object> >>> b.iter_element_items().reduce.from_label_pair_map({('b', 'b-min'): lambda l, s: np.min(s), ('b', 'b-max'): lambda l, s: np.max(s)}).to_frame() <Frame> <Index> b-min b-max <<U5> <Index> x 1.0 5.0 y nan nan v 41.0 45.0 w nan nan <<U1> <float64> <float64>
Bus: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Selector | Iterator | Accessor Hashlib | Accessor Type Clinic | Accessor Mapping