snowflake.snowpark.functions.st_y¶

snowflake.snowpark.functions.st_y(geography_or_geometry_expression: Union[snowflake.snowpark.column.Column, str]) → Column[source]¶

Returns the Y coordinate of a POINT, or None if the input is not a POINT.

Parameters:

geography_or_geometry_expression (ColumnOrName) – A GEOGRAPHY or GEOMETRY object representing points.

Returns:

The Y coordinate values as floating-point numbers.

Return type:

Column

Examples::
>>> from snowflake.snowpark.functions import to_geography
>>> from snowflake.snowpark.functions import st_makepoint
>>> df = session.create_dataframe([[37.5, 45.5], [40.0, 60.0]], schema=["x", "y"])
>>> df.select(st_y(to_geography(st_makepoint(df["x"], df["y"]))).alias("y_coord")).collect()
[Row(Y_COORD=45.5), Row(Y_COORD=60.0)]
Copy