Function Application

All functions · nseries package

Func

func (s Series) Func(fn any, args ...any) Series

Func applies a function to the receiver. Supported signatures are func() Series, func(Series) Series, func() []float64, and func([]float64) []float64, including defined function types with those exact underlying signatures. The callback is invoked once; its result is returned directly, preserving any aliasing chosen by the callback. Unsupported or typed-nil callbacks return receiver-length zeros. The optional args are unused.