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

snowflake.snowpark.functions.approx_percentile_estimate

snowflake.snowpark.functions.approx_percentile_estimate(state: Union[Column, str], percentile: float) Column[source]

Returns the desired approximated percentile value for the specified t-Digest state. APPROX_PERCENTILE_ESTIMATE(APPROX_PERCENTILE_ACCUMULATE(.)) is equivalent to APPROX_PERCENTILE(.).

Example::
>>> df = session.create_dataframe([1,2,3,4,5], schema=["a"])
>>> df_accu = df.select(approx_percentile_accumulate("a").alias("app_percentile_accu"))
>>> df_accu.select(approx_percentile_estimate("app_percentile_accu", 0.5).alias("result")).show()
------------
|"RESULT"  |
------------
|3.0       |
------------
Copy