puffbird.FrameEngine.apply

FrameEngine.apply(func, new_col_name, *args, assign_to_index=False, map_kws=None, **kwargs)[source]

Apply a function to each row in the table.

Parameters
funccallable

Function to apply. The function cannot return a Series object.

new_col_namestr

Name of computed new column. If None, new_col_name will be “apply_result”.

argstuple

Arguments passed to function. Each argument should be an “index column” or “data column” in the table. Thus, the argument will correspond to the cell value for each row.

assign_to_indexbool, optional

Assign new column as “index column”, instead of as “data column”..

map_kwsdict

Same as args just as keyword arguments.

kwargs: dict

Keyword arguments passed to function as is.

Returns
self