eelbrain.Var.from_apply

classmethod Var.from_apply(base, func, name=None, info=None)

Construct a Var instance by applying a function to each value in a base

Parameters:
base : sequence, len = n

Base for the new Var. Can be an NDVar, if func is a dimensionality reducing function such as numpy.mean().

func : callable

A function that when applied to each element in base returns the desired value for the resulting Var.

name : str

Name for the new Var.

info : dict

Info for the new Var.