snowflake.snowpark.functions.mod¶

snowflake.snowpark.functions.mod(expr1: Union[snowflake.snowpark.column.Column, str], expr2: Union[snowflake.snowpark.column.Column, str]) → Column[source]¶

Returns the remainder of expr1 divided by expr2.

Parameters:
  • expr1 (ColumnOrName) – The dividend column or column name.

  • expr2 (ColumnOrName) – The divisor column or column name.

Returns:

The remainder of expr1 divided by expr2.

Return type:

Column

Examples::
>>> from snowflake.snowpark.functions import col
>>> df = session.create_dataframe([[10, 3], [15, 4], [7, 2]], schema=["a", "b"])
>>> df.select(mod(col("a"), col("b")).alias("mod_result")).collect()
[Row(MOD_RESULT=1), Row(MOD_RESULT=3), Row(MOD_RESULT=1)]
Copy