Detail: Series: Accessor Values

Overview: Series: Accessor Values

Series.via_values.apply(func, *args, **kwargs)
Series.via_values

Interface for applying functions to values (as arrays) in this container.

InterfaceValues.apply(func, *args, **kwargs)[source]
>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> s.via_values.apply(np.sin)
<Series>
<Index>
a        -0.5440211108893698
b        0.9092974268256817
c        0.9893582466233818
<<U1>    <float64>
Series.via_values.__array_ufunc__(ufunc, method, *args, **kwargs)
Series.via_values

Interface for applying functions to values (as arrays) in this container.

InterfaceValues.__array_ufunc__(ufunc, method, *args, **kwargs)[source]

Support for applying NumPy functions directly on containers.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> np.sin(s.via_values)
<Series>
<Index>
a        -0.5440211108893698
b        0.9092974268256817
c        0.9893582466233818
<<U1>    <float64>
Series.via_values.__call__(*, consolidate_blocks, unify_blocks, dtype)
Series.via_values

Interface for applying functions to values (as arrays) in this container.

InterfaceValues.__call__(*, consolidate_blocks=False, unify_blocks=False, dtype=None)[source]
Parameters:
  • consolidate_blocks – Group adjacent same-typed arrays into 2D arrays.

  • unify_blocks – Group all arrays into single array, re-typing to an appropriate dtype.

  • dtype – specify a dtype to be used in conversion before consolidation or unification, and before function application.

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s
<Series>
<Index>
a        10
b        2
c        8
<<U1>    <int64>
>>> np.sin(s.via_values(unify_blocks=True))
<Series>
<Index>
a        -0.5440211108893698
b        0.9092974268256817
c        0.9893582466233818
<<U1>    <float64>

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