I have a SQL query that pulls the Lat/Long values of all stores. How do I find the distances between all stores in the column that is returned from the query? Is that even possible?
First, I imported the snowflake connector and established a connection to snowflake:
import snowflake.connector cnx = snowflake.connector.connect(user='XX', password='xxxx', account='xxxxxxxx', warehouse='abc', database='xxx', schema='xxx', role='xxxxxx')
Then I assigned my query to the variable below:
query = """SELECT store_latitude,store_longitude from randomdatabase.schema.latandlongs a WHERE a.store_longitude IS NOT NULL AND a.store_latitude IS NOT NULL"""
store = pd.read_sql_query(query,cnx)
How can I find the distance between all lat/long values returned by the query? Best way to achieve this?