snowflake.snowpark.functions.log2¶

snowflake.snowpark.functions.log2(x: Union[Column, str, int, float]) → Column[source]¶

Returns the base-2 logarithm of x.

Example:

>>> df = session.create_dataframe([1, 2, 8], schema=["a"])
>>> df.select(log2(df["a"]).alias("log2")).collect()
[Row(LOG2=0.0), Row(LOG2=1.0), Row(LOG2=3.0)]
Copy