pandas.Panel4D.apply

Panel4D.apply(func, axis='major', **kwargs)

Applies function along input axis of the Panel

Parameters :

func : function

Function to apply to each combination of ‘other’ axes e.g. if axis = ‘items’, then the combination of major_axis/minor_axis will be passed a Series

axis : {‘major’, ‘minor’, ‘items’}

Additional keyword arguments will be passed as keywords to the function

Returns :

result : Pandas Object

Examples

>>> p.apply(numpy.sqrt) # returns a Panel
>>> p.apply(lambda x: x.sum(), axis=0) # equiv to p.sum(0)
>>> p.apply(lambda x: x.sum(), axis=1) # equiv to p.sum(1)
>>> p.apply(lambda x: x.sum(), axis=2) # equiv to p.sum(2)