Applies an arbitrary pandas supported function to the values of an input column.
Series
.
For further detail see the corresponding pandas documentation.
However, only functions compatible with the column’s type should be used (not e.g. the function sum
when
the input column contains texts). To ensure the correct type given a desired function, you may cast the input
column to a different type before applying the function (see the in_type
parameter below).
Some additional functions specific to datetime, text and categorical columns are available under pandas’
dt
, str
, and cat
accessors.
See the acc
parameter below.
Also, any function available in numpy’s or pandas’ global namespace (i.e. as np.func
or pd.func
), and which
transform a singe element (rather than a whole column), may be applied to the elements of the input using
apply
as the func
parameter, and the name of a specific function as the elem_func
parameter.
Finally, the result of applying the desired function can be forced to a specific output type using the
out_type
parameter.
See below examples for usage in the different scenarios.
Examples
ds.first_name
), datasets (ds
or ds[["first_name", "last_name"]]
) or models (referenced
by name e.g. "churn-clf"
).
Inputs
Outputs
step(..., {"param": "value", ...}) -> (output)
.
Parameters
func
.Values must be one of the following:Category
Date
Number
Boolean
Url
Sex
Text
List[Number]
List[Category]
List[Url]
List[Boolean]
List[Date]
number
boolean
url
sex
text
list[number]
list[category]
list[url]
list[boolean]
list[date]
func
.Values must be one of the following:category
date
number
boolean
url
sex
text
list[number]
list[category]
list[url]
list[boolean]
list[date]
func
.
For further information see accessors.Values must be one of the following:str
dt
cat
func
is apply
, the name of a function to be applied to the elements of the input column.