Expression API¶
ColumnProxy¶
Represents a column identifier within an ActuarialFrame, acting as a starting point for expressions.
captures
property
¶
Access capture fields from a tracked rollforward.
Returns a dict-like accessor so that af.av.captures["name"]
lazily extracts the Capture(name) field from the hidden
rollforward Struct column.
date
property
¶
Access date-related column operations.
excel
property
¶
Access excel-related column operations.
finance
property
¶
Access finance-related column operations.
increments
property
¶
Access per-step increment fields from a tracked rollforward.
Returns a dict-like accessor so that af.av.increments["Premium"]
lazily extracts the Premium increment series from the hidden
rollforward Struct column.
Only meaningful when the rollforward was built with
track_increments=True.
shape
property
¶
Resolved shape of this column reference (scalar, list, or unknown).
map_batches(func, return_dtype=None)
¶
Apply a Python function to the entire column as a Series.
This is more efficient than apply for operations that can process multiple values at once, especially for NumPy or vector operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
Callable
|
Function that receives a Series and returns a Series or array |
required |
return_dtype
|
Optional polars DataType for the result |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ExpressionProxy |
ExpressionProxy
|
Result of applying the function |
map_elements(func, return_dtype=None)
¶
Apply a Python function to each element of the column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
Callable
|
Function to apply to each element |
required |
return_dtype
|
Optional polars DataType for the result |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ExpressionProxy |
ExpressionProxy
|
Result of applying the function |