You are viewing documentation about an older version (1.16.0). View latest version

snowflake.snowpark.functions.factorial

snowflake.snowpark.functions.factorial(e: Union[Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L1879-L1891)

Computes the factorial of its input. The input argument must be an integer expression in the range of 0 to 33.

Example:

>>> df = session.create_dataframe([0, 1, 5, 10], schema=["a"])
>>> df.select(factorial(df["a"]).alias("factorial")).collect()
[Row(FACTORIAL=1), Row(FACTORIAL=1), Row(FACTORIAL=120), Row(FACTORIAL=3628800)]
Copy
Language: English