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

snowflake.snowpark.functions.approx_percentile

snowflake.snowpark.functions.approx_percentile(col: Union[Column, str], percentile: float) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L1095-L1109)

Returns an approximated value for the desired percentile. This function uses the t-Digest algorithm.

Example::
>>> df = session.create_dataframe([0,1,2,3,4,5,6,7,8,9], schema=["a"])
>>> df.select(approx_percentile("a", 0.5).alias("result")).show()
------------
|"RESULT"  |
------------
|4.5       |
------------
Copy
Language: English