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

snowflake.snowpark.functions.log

snowflake.snowpark.functions.log(base: Union[Column, str, int, float], x: Union[Column, str, int, float]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.22.1/src/snowflake/snowpark/functions.py#L2469-L2484)

Returns the logarithm of a numeric expression.

Example:

>>> from snowflake.snowpark.types import IntegerType
>>> df = session.create_dataframe([1, 10], schema=["a"])
>>> df.select(log(10, df["a"]).cast(IntegerType()).alias("log")).collect()
[Row(LOG=0), Row(LOG=1)]
Copy
语言: 中文