// Apply takes a series of MutationFunc and calls them with the existing DataFrame on the left.
Apply takes a series of MutationFunc and calls them with the existing DataFrame on the left.
// Apply takes a series of MutationFunc and calls them with the existing DataFrame on the left .
func (df *DataFrame) Apply(fns ...MutationFunc) (*DataFrame, error) {
	left, err := df.Copy()
	if err != nil {
		return nil, err
	}
	if len(fns) == 0 {
		return left, err
	}
	for i := range fns {
		left, err = func() (*DataFrame, error) {
			defer left.Release()
			return fns[i](left)
		}()
		if err != nil {
			return nil, err
		}
	}
	return left, err
}
func ( df * DataFrame ) Apply ( fns ... MutationFunc ) ( * DataFrame , error ) { left , err := df . Copy ( ) if err != nil { return nil , err } if len ( fns ) == 0 { return left , err } for i := range fns { left , err = func ( ) ( * DataFrame , error ) { defer left . Release ( ) return fns [ i ] ( left ) } ( ) if err != nil { return nil , err } } return left , err }
Apply takes a series of MutationFunc and calls them with the existing DataFrame on the left.
Apply takes a series of MutationFunc and calls them with the existing DataFrame on the left .