module pixeltable.functions
General Pixeltable UDFs. This parent module contains general-purpose UDFs that apply to multiple data types.func map()
Signature
expr(pixeltable.exprs.expr.Expr): The list expression to map over; must be an expression of typepxt.Json.fn(typing.Callable[[pixeltable.exprs.expr.Expr], typing.Any]): An operation on Pixeltable expressions that will be applied to each element of the JSON array.
tbl with a column data of type pxt.Json containing lists of integers, add a computed column that produces new lists with each integer doubled:
uda count()
Signatures
val(String | None): The value to count.
pxt.Int: The count of non-null values.
value column of the table tbl:
category column and compute the count of non-null values in the value column for each category, assigning the name 'category_count' to the new column:
uda max()
Signatures
val(String | None): The value to compare.
pxt.String | None: The maximum value, orNoneif there are no non-null values.
value column of the table tbl:
category column and compute the maximum value in the value column for each category, assigning the name 'category_max' to the new column:
uda mean()
Signatures
val(Int | None): The numeric value to include in the mean.
pxt.Float | None: The mean of the non-null values, orNoneif there are no non-null values.
value column of the table tbl:
category column and compute the mean of the value column for each category, assigning the name 'category_mean' to the new column:
uda min()
Signatures
val(String | None): The value to compare.
pxt.String | None: The minimum value, orNoneif there are no non-null values.
value column of the table tbl:
category column and compute the minimum value in the value column for each category, assigning the name 'category_min' to the new column:
uda sum()
Signatures
val(Int | None): The numeric value to add to the sum.
pxt.Int | None: The sum of the non-null values, orNoneif there are no non-null values.
value column of the table tbl:
category column and compute the sum of the value column for each category, assigning the name 'category_total' to the new column: