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

snowflake.snowpark.functions.factorial

snowflake.snowpark.functions.factorial(e: Union[Column, str]) Column[source]

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