Created
June 22, 2015 15:02
-
-
Save msure/ca961bf8357f6844b436 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
from sqlalchemy import create_engine | |
# what is the database equivalent of 'hello world' anyways? | |
test_query = """ | |
SELECT COUNT(*) | |
FROM core.users a | |
WHERE a.date BETWEEN '2015-01-01' AND '2015-05-31' | |
GROUP BY 1 | |
""" | |
red_engine = create_engine('redshift+psycopg2://username:password@your.redshift.host.123456abcdef.us-east-1.redshift.amazonaws.com:5439/database') | |
test = pd.read_sql_query(test_query,red_engine) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment