Detail: Series: Iterator#

Overview: Series: Iterator

Series.iter_element
iter_element

Iterator of elements.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_element())
(np.int64(2), np.int64(8), np.int64(19), np.int64(34), np.int64(54))
Series.iter_element().apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_element

Iterator of elements.

IterNodeDelegateMapable.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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> s.iter_element().apply(lambda e: e > 10)
<Series>
<Index>
a        False
b        False
c        True
d        True
e        True
<<U1>    <bool>
Series.iter_element().apply_iter(func)
iter_element

Iterator of elements.

IterNodeDelegateMapable.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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_element().apply_iter(lambda e: e > 10))
(np.False_, np.False_, np.True_, np.True_, np.True_)
Series.iter_element().apply_iter_items(func)
iter_element

Iterator of elements.

IterNodeDelegateMapable.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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_element().apply_iter_items(lambda e: e > 10))
((np.str_('a'), np.False_), (np.str_('b'), np.False_), (np.str_('c'), np.True_), (np.str_('d'), np.True_), (np.str_('e'), np.True_))
Series.iter_element().apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_element

Iterator of elements.

IterNodeDelegateMapable.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; None defaults 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.

>>> def func(e): return e > 10
>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> s.iter_element().apply_pool(func, use_threads=True)
<Series>
<Index>
a        False
b        False
c        True
d        True
e        True
<<U1>    <bool>
Series.iter_element().map_all(mapping, *, dtype, name, index_constructor)
iter_element

Iterator of elements.

IterNodeDelegateMapable.map_all(mapping, /, *, dtype=None, name=None, index_constructor=None)[source]

Apply a mapping; for values not in the mapping, an Exception is raised. Returns a new container.

Parameters:
  • mapping – A mapping type, such as a dictionary or Series.

  • dtype – A value suitable for specyfying a NumPy dtype, such as a Python type (float), NumPy array protocol strings (‘f8’), or a dtype instance.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> s.iter_element().map_all({2: 200, 10: -1, 8: 45})
<Series>
<Index>
a        -1
b        200
c        45
<<U1>    <int64>
Series.iter_element().map_all_iter(mapping)
iter_element

Iterator of elements.

IterNodeDelegateMapable.map_all_iter(mapping, /)[source]

Apply a mapping; for values not in the mapping, an Exception is raised. A generator of resulting values.

Parameters:

mapping – A mapping type, such as a dictionary or Series.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_element().map_all_iter({2: 200, 10: -1, 8: 45}))
(-1, 200, 45)
Series.iter_element().map_all_iter_items(mapping)
iter_element

Iterator of elements.

IterNodeDelegateMapable.map_all_iter_items(mapping, /)[source]

Apply a mapping; for values not in the mapping, an Exception is raised. A generator of resulting key, value pairs.

Parameters:

mapping – A mapping type, such as a dictionary or Series.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_element().map_all_iter_items({2: 200, 10: -1, 8: 45}))
((np.str_('a'), -1), (np.str_('b'), 200), (np.str_('c'), 45))
Series.iter_element().map_any(mapping, *, dtype, name, index_constructor)
iter_element

Iterator of elements.

IterNodeDelegateMapable.map_any(mapping, /, *, dtype=None, name=None, index_constructor=None)[source]

Apply a mapping; for values not in the mapping, the value is returned. Returns a new container.

Parameters:
  • mapping – A mapping type, such as a dictionary or Series.

  • dtype – A value suitable for specyfying a NumPy dtype, such as a Python type (float), NumPy array protocol strings (‘f8’), or a dtype instance.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> s.iter_element().map_any({10: -1, 8: 45})
<Series>
<Index>
a        -1
b        2
c        45
<<U1>    <int64>
Series.iter_element().map_any_iter(mapping)
iter_element

Iterator of elements.

IterNodeDelegateMapable.map_any_iter(mapping, /)[source]

Apply a mapping; for values not in the mapping, the value is returned. A generator of resulting values.

Parameters:

mapping – A mapping type, such as a dictionary or Series.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_element().map_any_iter({10: -1, 8: 45}))
(-1, np.int64(2), 45)
Series.iter_element().map_any_iter_items(mapping)
iter_element

Iterator of elements.

IterNodeDelegateMapable.map_any_iter_items(mapping, /)[source]

Apply a mapping; for values not in the mapping, the value is returned. A generator of resulting key, value pairs.

Parameters:

mapping – A mapping type, such as a dictionary or Series.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_element().map_any_iter_items({10: -1, 8: 45}))
((np.str_('a'), -1), (np.str_('b'), np.int64(2)), (np.str_('c'), 45))
Series.iter_element().map_fill(mapping, *, fill_value, dtype, name, index_constructor)
iter_element

Iterator of elements.

IterNodeDelegateMapable.map_fill(mapping, /, *, fill_value=nan, dtype=None, name=None, index_constructor=None)[source]

Apply a mapping; for values not in the mapping, the fill_value is returned. Returns a new container.

Parameters:
  • mapping – A mapping type, such as a dictionary or Series.

  • fill_value – Value to be returned if the values is not a key in the mapping.

  • dtype – A value suitable for specyfying a NumPy dtype, such as a Python type (float), NumPy array protocol strings (‘f8’), or a dtype instance.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> s.iter_element().map_fill({10: -1, 8: 45}, fill_value=np.nan)
<Series>
<Index>
a        -1.0
b        nan
c        45.0
<<U1>    <float64>
Series.iter_element().map_fill_iter(mapping, *, fill_value)
iter_element

Iterator of elements.

IterNodeDelegateMapable.map_fill_iter(mapping, /, *, fill_value=nan)[source]

Apply a mapping; for values not in the mapping, the fill_value is returned. A generator of resulting values.

Parameters:
  • mapping – A mapping type, such as a dictionary or Series.

  • fill_value – Value to be returned if the values is not a key in the mapping.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_element().map_fill_iter({10: -1, 8: 45}, fill_value=np.nan))
(-1, nan, 45)
Series.iter_element().map_fill_iter_items(mapping, *, fill_value)
iter_element

Iterator of elements.

IterNodeDelegateMapable.map_fill_iter_items(mapping, /, *, fill_value=nan)[source]

Apply a mapping; for values not in the mapping, the fill_value is returned. A generator of resulting key, value pairs.

Parameters:
  • mapping – A mapping type, such as a dictionary or Series.

  • fill_value – Value to be returned if the values is not a key in the mapping.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_element().map_fill_iter_items({10: -1, 8: 45}, fill_value=np.nan))
((np.str_('a'), -1), (np.str_('b'), nan), (np.str_('c'), 45))
Series.iter_element_items
iter_element_items

Iterator of label, element pairs.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_element_items())
((np.str_('a'), np.int64(2)), (np.str_('b'), np.int64(8)), (np.str_('c'), np.int64(19)), (np.str_('d'), np.int64(34)), (np.str_('e'), np.int64(54)))
Series.iter_element_items().apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> s.iter_element_items().apply(lambda l, e: e > 10 if l != 'c' else 0)
<Series>
<Index>
a        0
b        0
c        0
d        1
e        1
<<U1>    <int64>
Series.iter_element_items().apply_iter(func)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_element_items().apply_iter(lambda l, e: e > 10 and l != 'e'))
(np.False_, np.False_, True, True, False)
Series.iter_element_items().apply_iter_items(func)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_element_items().apply_iter_items(lambda l, e: e > 10 and l != 'e'))
((np.str_('a'), np.False_), (np.str_('b'), np.False_), (np.str_('c'), True), (np.str_('d'), True), (np.str_('e'), False))
Series.iter_element_items().apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.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; None defaults 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.

>>> def func(pair): return pair[1] > 10 and pair[0] != 'e'
>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> s.iter_element_items().apply_pool(func, use_threads=True)
<Series>
<Index>
a        False
b        False
c        True
d        True
e        False
<<U1>    <bool>
Series.iter_element_items().map_all(mapping, *, dtype, name, index_constructor)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.map_all(mapping, /, *, dtype=None, name=None, index_constructor=None)[source]

Apply a mapping; for values not in the mapping, an Exception is raised. Returns a new container.

Parameters:
  • mapping – A mapping type, such as a dictionary or Series.

  • dtype – A value suitable for specyfying a NumPy dtype, such as a Python type (float), NumPy array protocol strings (‘f8’), or a dtype instance.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> s.iter_element_items().map_all({('b', 2): 200, ('a', 10): -1, ('c', 8): 45})
<Series>
<Index>
a        -1
b        200
c        45
<<U1>    <int64>
Series.iter_element_items().map_all_iter(mapping)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.map_all_iter(mapping, /)[source]

Apply a mapping; for values not in the mapping, an Exception is raised. A generator of resulting values.

Parameters:

mapping – A mapping type, such as a dictionary or Series.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_element_items().map_all_iter({('b', 2): 200, ('a', 10): -1, ('c', 8): 45}))
(-1, 200, 45)
Series.iter_element_items().map_all_iter_items(mapping)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.map_all_iter_items(mapping, /)[source]

Apply a mapping; for values not in the mapping, an Exception is raised. A generator of resulting key, value pairs.

Parameters:

mapping – A mapping type, such as a dictionary or Series.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_element_items().map_all_iter_items({('b', 2): 200, ('a', 10): -1, ('c', 8): 45}))
((np.str_('a'), -1), (np.str_('b'), 200), (np.str_('c'), 45))
Series.iter_element_items().map_any(mapping, *, dtype, name, index_constructor)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.map_any(mapping, /, *, dtype=None, name=None, index_constructor=None)[source]

Apply a mapping; for values not in the mapping, the value is returned. Returns a new container.

Parameters:
  • mapping – A mapping type, such as a dictionary or Series.

  • dtype – A value suitable for specyfying a NumPy dtype, such as a Python type (float), NumPy array protocol strings (‘f8’), or a dtype instance.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> s.iter_element_items().map_any({('a', 10): -1, ('c', 8): 45})
<Series>
<Index>
a        -1
b        2
c        45
<<U1>    <int64>
Series.iter_element_items().map_any_iter(mapping)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.map_any_iter(mapping, /)[source]

Apply a mapping; for values not in the mapping, the value is returned. A generator of resulting values.

Parameters:

mapping – A mapping type, such as a dictionary or Series.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_element_items().map_any_iter({('a', 10): -1, ('c', 8): 45}))
(-1, np.int64(2), 45)
Series.iter_element_items().map_any_iter_items(mapping)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.map_any_iter_items(mapping, /)[source]

Apply a mapping; for values not in the mapping, the value is returned. A generator of resulting key, value pairs.

Parameters:

mapping – A mapping type, such as a dictionary or Series.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_element_items().map_any_iter_items({('a', 10): -1, ('c', 8): 45}))
((np.str_('a'), -1), (np.str_('b'), np.int64(2)), (np.str_('c'), 45))
Series.iter_element_items().map_fill(mapping, *, fill_value, dtype, name, index_constructor)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.map_fill(mapping, /, *, fill_value=nan, dtype=None, name=None, index_constructor=None)[source]

Apply a mapping; for values not in the mapping, the fill_value is returned. Returns a new container.

Parameters:
  • mapping – A mapping type, such as a dictionary or Series.

  • fill_value – Value to be returned if the values is not a key in the mapping.

  • dtype – A value suitable for specyfying a NumPy dtype, such as a Python type (float), NumPy array protocol strings (‘f8’), or a dtype instance.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> s.iter_element_items().map_fill({('a', 10): -1, ('c', 8): 45}, fill_value=np.nan)
<Series>
<Index>
a        -1.0
b        nan
c        45.0
<<U1>    <float64>
Series.iter_element_items().map_fill_iter(mapping, *, fill_value)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.map_fill_iter(mapping, /, *, fill_value=nan)[source]

Apply a mapping; for values not in the mapping, the fill_value is returned. A generator of resulting values.

Parameters:
  • mapping – A mapping type, such as a dictionary or Series.

  • fill_value – Value to be returned if the values is not a key in the mapping.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_element_items().map_fill_iter({('a', 10): -1, ('c', 8): 45}, fill_value=np.nan))
(-1, nan, 45)
Series.iter_element_items().map_fill_iter_items(mapping, *, fill_value)
iter_element_items

Iterator of label, element pairs.

IterNodeDelegateMapable.map_fill_iter_items(mapping, /, *, fill_value=nan)[source]

Apply a mapping; for values not in the mapping, the fill_value is returned. A generator of resulting key, value pairs.

Parameters:
  • mapping – A mapping type, such as a dictionary or Series.

  • fill_value – Value to be returned if the values is not a key in the mapping.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_element_items().map_fill_iter_items({('a', 10): -1, ('c', 8): 45}, fill_value=np.nan))
((np.str_('a'), -1), (np.str_('b'), nan), (np.str_('c'), 45))
Series.iter_group(*, axis)
iter_group

Iterator of Series, where each Series matches unique values.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group())
(<Series>
<Index>
a        -2
d        -2
<<U1>    <int64>, <Series>
<Index>
b        8
e        8
<<U1>    <int64>, <Series>
<Index>
c        19
<<U1>    <int64>)
Series.iter_group(*, axis).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_group

Iterator of Series, where each Series matches unique values.

IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group().apply(lambda s: s.sum())
<Series>
<Index>
-2       -4
8        16
19       19
<int64>  <int64>
Series.iter_group(*, axis).apply_iter(func)
iter_group

Iterator of Series, where each Series matches unique values.

IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group().apply_iter(lambda s: s.sum()))
(np.int64(-4), np.int64(16), np.int64(19))
Series.iter_group(*, axis).apply_iter_items(func)
iter_group

Iterator of Series, where each Series matches unique values.

IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group().apply_iter_items(lambda s: s.sum()))
((np.int64(-2), np.int64(-4)), (np.int64(8), np.int64(16)), (np.int64(19), np.int64(19)))
Series.iter_group(*, axis).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_group

Iterator of Series, where each Series matches unique values.

IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> def func(s): return s.sum()
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group().apply_pool(func, use_threads=True)
<Series>
<Index>
-2       -4
8        16
19       19
<int64>  <int64>
Series.iter_group_array(*, axis)
iter_group_array

Iterator of Series, where each Series matches unique values.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_array())
(array([-2, -2]), array([8, 8]), array([19]))
Series.iter_group_array(*, axis).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_group_array

Iterator of Series, where each Series matches unique values.

IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_array().apply(lambda s: s.sum())
<Series>
<Index>
-2       -4
8        16
19       19
<int64>  <int64>
Series.iter_group_array(*, axis).apply_iter(func)
iter_group_array

Iterator of Series, where each Series matches unique values.

IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_array().apply_iter(lambda s: s.sum()))
(np.int64(-4), np.int64(16), np.int64(19))
Series.iter_group_array(*, axis).apply_iter_items(func)
iter_group_array

Iterator of Series, where each Series matches unique values.

IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_array().apply_iter_items(lambda s: s.sum()))
((np.int64(-2), np.int64(-4)), (np.int64(8), np.int64(16)), (np.int64(19), np.int64(19)))
Series.iter_group_array(*, axis).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_group_array

Iterator of Series, where each Series matches unique values.

IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> def func(s): return s.sum()
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_array().apply_pool(func, use_threads=True)
<Series>
<Index>
-2       -4
8        16
19       19
<int64>  <int64>
Series.iter_group_array_items(*, axis)
iter_group_array_items
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_array_items())
((np.int64(-2), array([-2, -2])), (np.int64(8), array([8, 8])), (np.int64(19), array([19])))
Series.iter_group_array_items(*, axis).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_group_array_items
IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_array_items().apply(lambda l, s: s.sum() if l != 8 else s.shape)
<Series>
<Index>
-2       -4
8        (2,)
19       19
<int64>  <object>
Series.iter_group_array_items(*, axis).apply_iter(func)
iter_group_array_items
IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_array_items().apply_iter(lambda l, s: s.sum() if l != 8 else -1))
(np.int64(-4), -1, np.int64(19))
Series.iter_group_array_items(*, axis).apply_iter_items(func)
iter_group_array_items
IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_array_items().apply_iter_items(lambda l, s: s.sum() if l != 8 else -1))
((np.int64(-2), np.int64(-4)), (np.int64(8), -1), (np.int64(19), np.int64(19)))
Series.iter_group_array_items(*, axis).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_group_array_items
IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> def func(pair): return pair[1].sum()
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_array_items().apply_pool(func, use_threads=True)
<Series>
<Index>
-2       -4
8        16
19       19
<int64>  <int64>
Series.iter_group_items(*, axis)
iter_group_items
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_items())
((np.int64(-2), <Series>
<Index>
a        -2
d        -2
<<U1>    <int64>), (np.int64(8), <Series>
<Index>
b        8
e        8
<<U1>    <int64>), (np.int64(19), <Series>
<Index>
c        19
<<U1>    <int64>))
Series.iter_group_items(*, axis).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_group_items
IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_items().apply(lambda l, s: s.sum() if l != 8 else s.shape)
<Series>
<Index>
-2       -4
8        (2,)
19       19
<int64>  <object>
Series.iter_group_items(*, axis).apply_iter(func)
iter_group_items
IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_items().apply_iter(lambda l, s: s.sum() if l != 8 else -1))
(np.int64(-4), -1, np.int64(19))
Series.iter_group_items(*, axis).apply_iter_items(func)
iter_group_items
IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_items().apply_iter_items(lambda l, s: s.sum() if l != 8 else -1))
((np.int64(-2), np.int64(-4)), (np.int64(8), -1), (np.int64(19), np.int64(19)))
Series.iter_group_items(*, axis).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_group_items
IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> def func(pair): return pair[1].sum()
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_items().apply_pool(func, use_threads=True)
<Series>
<Index>
-2       -4
8        16
19       19
<int64>  <int64>
Series.iter_group_labels(depth_level)
iter_group_labels
>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_group_labels())
(<Series>
<Index>
a        10
<<U1>    <int64>, <Series>
<Index>
b        2
<<U1>    <int64>, <Series>
<Index>
c        8
<<U1>    <int64>)
Series.iter_group_labels(depth_level).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_group_labels
IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_labels().apply(lambda s: s.sum())
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
Series.iter_group_labels(depth_level).apply_iter(func)
iter_group_labels
IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_labels().apply_iter(lambda s: s.sum()))
(np.int64(-2), np.int64(8), np.int64(19), np.int64(-2), np.int64(8))
Series.iter_group_labels(depth_level).apply_iter_items(func)
iter_group_labels
IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_labels().apply_iter_items(lambda s: s.sum()))
((np.str_('a'), np.int64(-2)), (np.str_('b'), np.int64(8)), (np.str_('c'), np.int64(19)), (np.str_('d'), np.int64(-2)), (np.str_('e'), np.int64(8)))
Series.iter_group_labels(depth_level).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_group_labels
IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> def func(s): return s.sum()
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_labels().apply_pool(func, use_threads=True)
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
Series.iter_group_labels_array(depth_level)
iter_group_labels_array
>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_group_labels_array())
(array([10]), array([2]), array([8]))
Series.iter_group_labels_array(depth_level).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_group_labels_array
IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_labels_array().apply(lambda s: s.sum())
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
Series.iter_group_labels_array(depth_level).apply_iter(func)
iter_group_labels_array
IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_labels_array().apply_iter(lambda s: s.sum()))
(np.int64(-2), np.int64(8), np.int64(19), np.int64(-2), np.int64(8))
Series.iter_group_labels_array(depth_level).apply_iter_items(func)
iter_group_labels_array
IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_labels_array().apply_iter_items(lambda s: s.sum()))
((np.str_('a'), np.int64(-2)), (np.str_('b'), np.int64(8)), (np.str_('c'), np.int64(19)), (np.str_('d'), np.int64(-2)), (np.str_('e'), np.int64(8)))
Series.iter_group_labels_array(depth_level).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_group_labels_array
IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> def func(s): return s.sum()
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_labels_array().apply_pool(func, use_threads=True)
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
Series.iter_group_labels_array_items(depth_level)
iter_group_labels_array_items
>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_group_labels_array_items())
((np.str_('a'), array([10])), (np.str_('b'), array([2])), (np.str_('c'), array([8])))
Series.iter_group_labels_array_items(depth_level).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_group_labels_array_items
IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_labels_array_items().apply(lambda l, s: s.sum() if l != 8 else s.shape)
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
Series.iter_group_labels_array_items(depth_level).apply_iter(func)
iter_group_labels_array_items
IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_labels_array_items().apply_iter(lambda l, s: s.sum() if l != 8 else -1))
(np.int64(-2), np.int64(8), np.int64(19), np.int64(-2), np.int64(8))
Series.iter_group_labels_array_items(depth_level).apply_iter_items(func)
iter_group_labels_array_items
IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_labels_array_items().apply_iter_items(lambda l, s: s.sum() if l != 8 else -1))
((np.str_('a'), np.int64(-2)), (np.str_('b'), np.int64(8)), (np.str_('c'), np.int64(19)), (np.str_('d'), np.int64(-2)), (np.str_('e'), np.int64(8)))
Series.iter_group_labels_array_items(depth_level).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_group_labels_array_items
IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> def func(pair): return pair[1].sum()
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_labels_array_items().apply_pool(func, use_threads=True)
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
Series.iter_group_labels_items(depth_level)
iter_group_labels_items
>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> tuple(s.iter_group_labels_items())
((np.str_('a'), <Series>
<Index>
a        10
<<U1>    <int64>), (np.str_('b'), <Series>
<Index>
b        2
<<U1>    <int64>), (np.str_('c'), <Series>
<Index>
c        8
<<U1>    <int64>))
Series.iter_group_labels_items(depth_level).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_group_labels_items
IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_labels_items().apply(lambda l, s: s.sum() if l != 8 else s.shape)
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
Series.iter_group_labels_items(depth_level).apply_iter(func)
iter_group_labels_items
IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_labels_items().apply_iter(lambda l, s: s.sum() if l != 8 else -1))
(np.int64(-2), np.int64(8), np.int64(19), np.int64(-2), np.int64(8))
Series.iter_group_labels_items(depth_level).apply_iter_items(func)
iter_group_labels_items
IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_labels_items().apply_iter_items(lambda l, s: s.sum() if l != 8 else -1))
((np.str_('a'), np.int64(-2)), (np.str_('b'), np.int64(8)), (np.str_('c'), np.int64(19)), (np.str_('d'), np.int64(-2)), (np.str_('e'), np.int64(8)))
Series.iter_group_labels_items(depth_level).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_group_labels_items
IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> def func(pair): return pair[1].sum()
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_labels_items().apply_pool(func, use_threads=True)
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
Series.iter_group_other(other, *, fill_value, axis)
iter_group_other

Iterator of Series, grouped by unique values found in the passed container.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_other(np.arange(len(s)) % 2))
(<Series>
<Index>
a        -2
c        19
e        8
<<U1>    <int64>, <Series>
<Index>
b        8
d        -2
<<U1>    <int64>)
Series.iter_group_other(other, *, fill_value, axis).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_group_other

Iterator of Series, grouped by unique values found in the passed container.

IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_other(np.arange(len(s)) % 3).apply(lambda s: s.sum())
<Series>
<Index>
0        -4
1        16
2        19
<int64>  <int64>
Series.iter_group_other(other, *, fill_value, axis).apply_iter(func)
iter_group_other

Iterator of Series, grouped by unique values found in the passed container.

IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_other(np.arange(len(s)) % 3).apply_iter(lambda s: s.sum()))
(np.int64(-4), np.int64(16), np.int64(19))
Series.iter_group_other(other, *, fill_value, axis).apply_iter_items(func)
iter_group_other

Iterator of Series, grouped by unique values found in the passed container.

IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_other(np.arange(len(s)) % 3).apply_iter_items(lambda s: s.sum()))
((np.int64(0), np.int64(-4)), (np.int64(1), np.int64(16)), (np.int64(2), np.int64(19)))
Series.iter_group_other(other, *, fill_value, axis).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_group_other

Iterator of Series, grouped by unique values found in the passed container.

IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> def func(s): return s.sum()
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_other(np.arange(len(s)) % 3).apply_pool(func, use_threads=True)
<Series>
<Index>
0        -4
1        16
2        19
<int64>  <int64>
Series.iter_group_other_array(other, *, fill_value, axis)
iter_group_other_array
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_other_array(np.arange(len(s)) % 2))
(array([-2, 19,  8]), array([ 8, -2]))
Series.iter_group_other_array(other, *, fill_value, axis).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_group_other_array
IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_other_array(np.arange(len(s)) % 3).apply(lambda s: s.sum())
<Series>
<Index>
0        -4
1        16
2        19
<int64>  <int64>
Series.iter_group_other_array(other, *, fill_value, axis).apply_iter(func)
iter_group_other_array
IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_other_array(np.arange(len(s)) % 3).apply_iter(lambda s: s.sum()))
(np.int64(-4), np.int64(16), np.int64(19))
Series.iter_group_other_array(other, *, fill_value, axis).apply_iter_items(func)
iter_group_other_array
IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_other_array(np.arange(len(s)) % 3).apply_iter_items(lambda s: s.sum()))
((np.int64(0), np.int64(-4)), (np.int64(1), np.int64(16)), (np.int64(2), np.int64(19)))
Series.iter_group_other_array(other, *, fill_value, axis).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_group_other_array
IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> def func(s): return s.sum()
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_other_array(np.arange(len(s)) % 3).apply_pool(func, use_threads=True)
<Series>
<Index>
0        -4
1        16
2        19
<int64>  <int64>
Series.iter_group_other_array_items(other, *, fill_value, axis)
iter_group_other_array_items
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_other_array_items(np.arange(len(s)) % 2))
((np.int64(0), array([-2, 19,  8])), (np.int64(1), array([ 8, -2])))
Series.iter_group_other_array_items(other, *, fill_value, axis).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_group_other_array_items
IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_other_array_items(np.arange(len(s)) % 3).apply(lambda k, v: v.sum())
<Series>
<Index>
0        -4
1        16
2        19
<int64>  <int64>
Series.iter_group_other_array_items(other, *, fill_value, axis).apply_iter(func)
iter_group_other_array_items
IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_other_array_items(np.arange(len(s)) % 3).apply_iter(lambda k, v: v.sum()))
(np.int64(-4), np.int64(16), np.int64(19))
Series.iter_group_other_array_items(other, *, fill_value, axis).apply_iter_items(func)
iter_group_other_array_items
IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_other_array_items(np.arange(len(s)) % 3).apply_iter_items(lambda k, v: v.sum()))
((np.int64(0), np.int64(-4)), (np.int64(1), np.int64(16)), (np.int64(2), np.int64(19)))
Series.iter_group_other_array_items(other, *, fill_value, axis).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_group_other_array_items
IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> def func(pair): return pair[1].sum()
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_other_array_items(np.arange(len(s)) % 3).apply_pool(func, use_threads=True)
<Series>
<Index>
0        -4
1        16
2        19
<int64>  <int64>
Series.iter_group_other_items(other, *, fill_value, axis)
iter_group_other_items

Iterator of pairs of label, Series, grouped by unique values found in the passed container.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_other_items(np.arange(len(s)) % 2))
((np.int64(0), <Series>
<Index>
a        -2
c        19
e        8
<<U1>    <int64>), (np.int64(1), <Series>
<Index>
b        8
d        -2
<<U1>    <int64>))
Series.iter_group_other_items(other, *, fill_value, axis).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_group_other_items

Iterator of pairs of label, Series, grouped by unique values found in the passed container.

IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_other_items(np.arange(len(s)) % 3).apply(lambda k, v: v.sum())
<Series>
<Index>
0        -4
1        16
2        19
<int64>  <int64>
Series.iter_group_other_items(other, *, fill_value, axis).apply_iter(func)
iter_group_other_items

Iterator of pairs of label, Series, grouped by unique values found in the passed container.

IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_other_items(np.arange(len(s)) % 3).apply_iter(lambda k, v: v.sum()))
(np.int64(-4), np.int64(16), np.int64(19))
Series.iter_group_other_items(other, *, fill_value, axis).apply_iter_items(func)
iter_group_other_items

Iterator of pairs of label, Series, grouped by unique values found in the passed container.

IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> tuple(s.iter_group_other_items(np.arange(len(s)) % 3).apply_iter_items(lambda k, v: v.sum()))
((np.int64(0), np.int64(-4)), (np.int64(1), np.int64(16)), (np.int64(2), np.int64(19)))
Series.iter_group_other_items(other, *, fill_value, axis).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_group_other_items

Iterator of pairs of label, Series, grouped by unique values found in the passed container.

IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> def func(pair): return pair[1].sum()
>>> s = sf.Series((-2, 8, 19, -2, 8), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        -2
b        8
c        19
d        -2
e        8
<<U1>    <int64>
>>> s.iter_group_other_items(np.arange(len(s)) % 3).apply_pool(func, use_threads=True)
<Series>
<Index>
0        -4
1        16
2        19
<int64>  <int64>
Series.iter_window(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment)
iter_window
>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> tuple(s.iter_window(size=3, step=1))
(<Series>
<Index>
a        2
b        8
c        19
<<U1>    <int64>, <Series>
<Index>
b        8
c        19
d        34
<<U1>    <int64>, <Series>
<Index>
c        19
d        34
e        54
<<U1>    <int64>)
Series.iter_window(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_window
IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> s.iter_window(size=3, step=1).apply(lambda s: s.sum())
<Series>
<Index>
c        29
d        61
e        107
<<U1>    <int64>
Series.iter_window(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply_iter(func)
iter_window
IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_window(size=3, step=1).apply_iter(lambda s: s.sum()))
(np.int64(29), np.int64(61), np.int64(107))
Series.iter_window(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply_iter_items(func)
iter_window
IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_window(size=3, step=1).apply_iter_items(lambda s: s.sum()))
((np.str_('c'), np.int64(29)), (np.str_('d'), np.int64(61)), (np.str_('e'), np.int64(107)))
Series.iter_window(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_window
IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> s.iter_window(size=3, step=1).apply_pool(lambda s: s.sum(), use_threads=True)
<Series>
<Index>
c        29
d        61
e        107
<<U1>    <int64>
Series.iter_window_array(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment)
iter_window_array
>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> tuple(s.iter_window_array(size=3, step=1))
(array([ 2,  8, 19]), array([ 8, 19, 34]), array([19, 34, 54]))
Series.iter_window_array(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_window_array
IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> s.iter_window_array(size=3, step=1).apply(lambda s: s.sum())
<Series>
<Index>
c        29
d        61
e        107
<<U1>    <int64>
Series.iter_window_array(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply_iter(func)
iter_window_array
IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_window_array(size=3, step=1).apply_iter(lambda s: s.sum()))
(np.int64(29), np.int64(61), np.int64(107))
Series.iter_window_array(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply_iter_items(func)
iter_window_array
IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_window_array(size=3, step=1).apply_iter_items(lambda s: s.sum()))
((np.str_('c'), np.int64(29)), (np.str_('d'), np.int64(61)), (np.str_('e'), np.int64(107)))
Series.iter_window_array(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_window_array
IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> s.iter_window_array(size=3, step=1).apply_pool(lambda s: s.sum(), use_threads=True)
<Series>
<Index>
c        29
d        61
e        107
<<U1>    <int64>
Series.iter_window_array_items(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment)
iter_window_array_items
>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> tuple(s.iter_window_array_items(size=3, step=1))
((np.str_('c'), array([ 2,  8, 19])), (np.str_('d'), array([ 8, 19, 34])), (np.str_('e'), array([19, 34, 54])))
Series.iter_window_array_items(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_window_array_items
IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> s.iter_window_array_items(size=3, step=1).apply(lambda l, s: s.sum() if l != 'd' else -1)
<Series>
<Index>
c        29
d        -1
e        107
<<U1>    <int64>
Series.iter_window_array_items(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply_iter(func)
iter_window_array_items
IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_window_array_items(size=3, step=1).apply_iter(lambda l, s: s.sum() if l != 'd' else -1))
(np.int64(29), -1, np.int64(107))
Series.iter_window_array_items(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply_iter_items(func)
iter_window_array_items
IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_window_array_items(size=3, step=1).apply_iter_items(lambda l, s: s.sum() if l != 'd' else -1))
((np.str_('c'), np.int64(29)), (np.str_('d'), -1), (np.str_('e'), np.int64(107)))
Series.iter_window_array_items(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_window_array_items
IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> s.iter_window_array_items(size=3, step=1).apply_pool(lambda pair: pair[1].sum(), use_threads=True)
<Series>
<Index>
c        29
d        61
e        107
<<U1>    <int64>
Series.iter_window_items(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment)
iter_window_items
>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> tuple(s.iter_window_items(size=3, step=1))
((np.str_('c'), <Series>
<Index>
a        2
b        8
c        19
<<U1>    <int64>), (np.str_('d'), <Series>
<Index>
b        8
c        19
d        34
<<U1>    <int64>), (np.str_('e'), <Series>
<Index>
c        19
d        34
e        54
<<U1>    <int64>))
Series.iter_window_items(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply(func, *, dtype, name, index_constructor, columns_constructor)
iter_window_items
IterNodeDelegate.apply(func, /, *, dtype=None, name=None, index_constructor=None, columns_constructor=None)[source]

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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> s.iter_window_items(size=3, step=1).apply(lambda l, s: s.sum() if l != 'd' else -1)
<Series>
<Index>
c        29
d        -1
e        107
<<U1>    <int64>
Series.iter_window_items(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply_iter(func)
iter_window_items
IterNodeDelegate.apply_iter(func, /)[source]

Apply a function to each value. A generator of resulting values.

Parameters:

func – A function that takes a value.

Yields:

Values after function application.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_window_items(size=3, step=1).apply_iter(lambda l, s: s.sum() if l != 'd' else -1))
(np.int64(29), -1, np.int64(107))
Series.iter_window_items(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply_iter_items(func)
iter_window_items
IterNodeDelegate.apply_iter_items(func, /)[source]

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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> tuple(s.iter_window_items(size=3, step=1).apply_iter_items(lambda l, s: s.sum() if l != 'd' else -1))
((np.str_('c'), np.int64(29)), (np.str_('d'), -1), (np.str_('e'), np.int64(107)))
Series.iter_window_items(*, size, axis, step, window_sized, window_func, window_valid, label_shift, label_missing_skips, label_missing_raises, start_shift, size_increment).apply_pool(func, *, dtype, name, index_constructor, max_workers, chunksize, use_threads)
iter_window_items
IterNodeDelegate.apply_pool(func, /, *, dtype=None, name=None, index_constructor=None, max_workers=None, chunksize=1, use_threads=False)[source]

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; None defaults 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.

>>> s = sf.Series((2, 8, 19, 34, 54), index=('a', 'b', 'c', 'd', 'e'))
>>> s
<Series>
<Index>
a        2
b        8
c        19
d        34
e        54
<<U1>    <int64>
>>> s.iter_window_items(size=3, step=1).apply_pool(lambda pair: pair[1].sum(), use_threads=True)
<Series>
<Index>
c        29
d        61
e        107
<<U1>    <int64>

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