snowflake.snowpark.functions.approx_percentile¶

snowflake.snowpark.functions.approx_percentile(col: Union[Column, str], percentile: float) → Column[source]¶

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