Pandas Integration
Use pandas to analyze Komodo data with familiar DataFrame operations.
Install Pandas to your existing uv project.
Section titled “Install Pandas to your existing uv project.”uv add pandaspip install pandasBasic Usage
Section titled “Basic Usage”The connection from get_snowflake_connection() works seamlessly with pandas:
from komodo import get_snowflake_connectionimport pandas as pd
# Get connectionconn = get_snowflake_connection()
cursor = conn.cursor()cursor.execute("USE DATABASE DATA")query = "SELECT column_name, table_name FROM INFORMATION_SCHEMA.COLUMNS;"
# Fetch the result set from the cursor and deliver it as the pandas DataFrame.cursor.execute(query)df = cursor.fetch_pandas_all()# https://docs.snowflake.com/en/developer-guide/python-connector/python-connector-api#fetch_pandas_allprint(df.head(20))print("total rows:", len(df))Exporting Results
Section titled “Exporting Results”Save DataFrame to various formats:
# Export to CSVdf.to_csv('results.csv', index=False)
# Export to Parquetdf.to_parquet('results.parquet', index=False)